Implicits

trait Implicits

The implicit resolution part of type checking

Companion
object
class Object
trait Matchable
class Any
class Typer
class ReTyper
class Typer
class Checker

Type members

Classlikes

class ImplicitSearch(val pt: Type, val argument: Tree, span: Span)(using `x$4`: Context)

An implicit search; parameters as in inferImplicit

An implicit search; parameters as in inferImplicit

Value members

Concrete methods

def assumedCanEqual(ltp: Type, rtp: Type)(using Context): Boolean

A CanEqual[T, U] instance is assumed

A CanEqual[T, U] instance is assumed

  • if one of T, U is an error type, or
  • if one of T, U is a subtype of the lifted version of the other, unless strict equality is set.
def checkCanEqual(ltp: Type, rtp: Type, span: Span)(using Context): Unit

Check that equality tests between types ltp and rtp make sense

Check that equality tests between types ltp and rtp make sense

def implicitArgTree(formal: Type, span: Span)(using Context): Tree

Search an implicit argument and report error if not found

Search an implicit argument and report error if not found

def implicitParamString(paramName: TermName, methodStr: String, tree: Tree)(using Context): String

A string indicating the formal parameter corresponding to a missing argument

A string indicating the formal parameter corresponding to a missing argument

def inferImplicit(pt: Type, argument: Tree, span: Span)(using Context): SearchResult

Find an implicit parameter or conversion.

Find an implicit parameter or conversion.

Value Params
argument

If an implicit conversion is searched, the argument to which it should be applied, EmptyTree otherwise.

pt

The expected type of the parameter or conversion.

span

The position where errors should be reported.

def inferImplicitArg(formal: Type, span: Span)(using Context): Tree

Find an implicit argument for parameter formal. Return a failure as a SearchFailureType in the type of the returned tree.

Find an implicit argument for parameter formal. Return a failure as a SearchFailureType in the type of the returned tree.

def inferView(from: Tree, to: Type)(using Context): SearchResult

Find an implicit conversion to apply to given tree from so that the result is compatible with type to.

Find an implicit conversion to apply to given tree from so that the result is compatible with type to.

def missingArgMsg(arg: Tree, pt: Type, where: String, paramSymWithMethodCallTree: Option[(Symbol, Tree)])(using Context): String
Value Params
arg

Tree representing a failed result of implicit search

paramSymWithMethodCallTree

Symbol of the parameter for which the implicit was searched and tree of the method call that triggered the implicit search

pt

Type for which an implicit value was searched

where

Description of where the search was performed. Might be empty

def typedImplicit(cand: Candidate, pt: Type, argument: Tree, span: Span)(using Context): SearchResult

Try to typecheck an implicit reference

Try to typecheck an implicit reference

override def viewExists(from: Type, to: Type)(using Context): Boolean
Definition Classes