Implicits

dotty.tools.dotc.typer.Implicits$
See theImplicits companion trait
object Implicits

Implicit resolution

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Implicits.type

Members list

Type members

Classlikes

class AmbiguousImplicits(val alt1: SearchSuccess, val alt2: SearchSuccess, val expectedType: Type, val argument: Tree) extends SearchFailureType

An ambiguous implicits failure

An ambiguous implicits failure

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
case class Candidate(implicitRef: ImplicitRef, kind: Kind, level: Int) extends RefAndLevel

An eligible implicit candidate, consisting of an implicit reference and a nesting level

An eligible implicit candidate, consisting of an implicit reference and a nesting level

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait RefAndLevel
class Object
trait Matchable
class Any
Show all
object Candidate

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Candidate.type
class ContextualImplicits(val refs: List[ImplicitRef], val outerImplicits: ContextualImplicits | Null, isImport: Boolean)(initctx: Context) extends ImplicitRefs

The implicit references coming from the context.

The implicit references coming from the context.

Value parameters

outerCtx

the next outer context that makes visible further implicits

refs

the implicit references made visible by the current context. Note: The name of the reference might be different from the name of its symbol. In the case of a renaming import a => b, the name of the reference is the renamed name, b, whereas the name of the symbol is the original name, a.

Attributes

Supertypes
class ImplicitRefs
class Object
trait Matchable
class Any
class DivergingImplicit(ref: TermRef, val expectedType: Type, val argument: Tree) extends SearchFailureType

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
class FailedExtension(extApp: Tree, val expectedType: Type, val whyFailed: Message) extends SearchFailureType

A search failure type for attempted ill-typed extension method calls

A search failure type for attempted ill-typed extension method calls

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
abstract class ImplicitRefs(initctx: Context)

A common base class of contextual implicits and of-type implicits which represents a set of references to implicit definitions.

A common base class of contextual implicits and of-type implicits which represents a set of references to implicit definitions.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
Self type
class MacroErrorsFailure(errors: List[Error], val expectedType: Type, val argument: Tree) extends SearchFailureType

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
class MismatchedImplicit(ref: TermRef, val expectedType: Type, val argument: Tree) extends SearchFailureType

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
class NestedFailure(_msg: Message, val expectedType: Type) extends SearchFailureType

A search failure type for aborted searches of extension methods, typically because of a cyclic reference or similar.

A search failure type for aborted searches of extension methods, typically because of a cyclic reference or similar.

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
class NoMatchingImplicits(val expectedType: Type, val argument: Tree, constraint: Constraint) extends SearchFailureType

Attributes

Companion
object
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
Known subtypes

Attributes

Companion
class
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
Self type
class OfTypeImplicits(tp: Type, val companionRefs: TermRefSet)(initctx: Context) extends ImplicitRefs

The implicit references coming from the implicit scope of a type.

The implicit references coming from the implicit scope of a type.

Value parameters

companionRefs

the companion objects in the implicit scope.

tp

the type determining the implicit scope

Attributes

Supertypes
class ImplicitRefs
class Object
trait Matchable
class Any
sealed trait RefAndLevel

Both search candidates and successes are references with a specific nesting level.

Both search candidates and successes are references with a specific nesting level.

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Candidate
class RenamedImplicitRef(val underlyingRef: TermRef, val alias: TermName) extends ImplicitRef

An implicit definition implicitRef that is visible under a different name, alias. Gets generated if an implicit ref is imported via a renaming import.

An implicit definition implicitRef that is visible under a different name, alias. Gets generated if an implicit ref is imported via a renaming import.

Attributes

Supertypes
trait ImplicitRef
class Object
trait Matchable
class Any
case class SearchFailure(tree: Tree) extends SearchResult

A failed search

A failed search

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class SearchResult
trait Showable
class Object
trait Matchable
class Any
Show all
object SearchFailure

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
abstract class SearchFailureType extends ErrorType

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
Known subtypes
sealed abstract class SearchResult extends Showable

The result of an implicit search

The result of an implicit search

Attributes

Supertypes
trait Showable
class Object
trait Matchable
class Any
Known subtypes
case class SearchSuccess(tree: Tree, ref: TermRef, level: Int, isExtension: Boolean)(tstate: TyperState, gstate: GadtConstraint) extends SearchResult, RefAndLevel, Showable

A successful search

A successful search

Value parameters

isExtension

Whether the result is an extension method application

level

The level where the reference was found

ref

The implicit reference that succeeded

tree

The typed tree that needs to be inserted

tstate

The typer state to be committed if this alternative is chosen

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait RefAndLevel
class SearchResult
trait Showable
class Object
trait Matchable
class Any
Show all
class SynthesisFailure(reasons: List[String], val expectedType: Type) extends SearchFailureType

A search failure type for failed synthesis of terms for special types

A search failure type for failed synthesis of terms for special types

Attributes

Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all
case class TooUnspecific(target: Type) extends NoMatchingImplicits

A failure value indicating that an implicit search for a conversion was not tried

A failure value indicating that an implicit search for a conversion was not tried

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def hasExtMethod(tp: Type, expected: Type)(using Context): Boolean

If expected is a selection prototype, does tp have an extension method with the selecting name? False otherwise.

If expected is a selection prototype, does tp have an extension method with the selecting name? False otherwise.

Attributes