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

Members list

Concise view

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

Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
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
Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
object Candidate

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self 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.

Attributes

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.

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

Attributes

Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
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

Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
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

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

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

Attributes

Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
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

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

Attributes

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

Attributes

Companion:
class
Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
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.

Attributes

companionRefs

the companion objects in the implicit scope.

tp

the type determining the implicit scope

Graph
Supertypes
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

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
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

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

A failed search

A failed search

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait Showable
class Object
trait Matchable
class Any

Attributes

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

Attributes

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

The result of an implicit search

The result of an implicit search

Attributes

Graph
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 with RefAndLevel with Showable

A successful search

A successful search

Attributes

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

Graph
Supertypes
trait Product
trait Equals
trait Showable
class Object
trait Matchable
class Any
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

Graph
Supertypes
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any
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

Graph
Supertypes
trait Product
trait Equals
class ErrorType
class FlexType
trait ValueType
trait TermType
class Type
trait Showable
trait Hashable
class Object
trait Matchable
class Any

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