OuterOps

dotty.tools.dotc.transform.ExplicitOuter.OuterOps
final class OuterOps(val ictx: Context) extends AnyVal

The operations in this class

  • add outer parameters
  • pass outer arguments to these parameters
  • replace outer this references by outer paths. They are called from erasure. There are two constraints which suggest these operations should be done in erasure.
  • Replacing this references with outer paths loses aliasing information, so programs will not typecheck with unerased types unless a lot of type refinements are added. Therefore, outer paths should be computed no earlier than erasure.
  • outer parameters should not show up in signatures, so again they cannot be added before erasure.
  • outer arguments need access to outer parameters as well as to the original type prefixes of types in New expressions. These prefixes get erased during erasure. Therefore, outer arguments have to be passed no later than erasure.

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def addParam(cls: ClassSymbol, tp: Type): Type

If cls has an outer parameter add one to the method type tp.

If cls has an outer parameter add one to the method type tp.

Attributes

def args(fun: Tree): List[Tree]

If function in an apply node is a constructor that needs to be passed an outer argument, the singleton list with the argument, otherwise Nil.

If function in an apply node is a constructor that needs to be passed an outer argument, the singleton list with the argument, otherwise Nil.

Attributes

def argsForNew(cls: ClassSymbol, tpe: Type): List[Tree]

If the constructors of the given cls need to be passed an outer argument, the singleton list with the argument, otherwise Nil.

If the constructors of the given cls need to be passed an outer argument, the singleton list with the argument, otherwise Nil.

Attributes

def path(start: Tree, toCls: Symbol, count: Int): Tree

A path of outer accessors starting from node start. start defaults to the context owner's this node. There are two alternative conditions that determine where the path ends:

A path of outer accessors starting from node start. start defaults to the context owner's this node. There are two alternative conditions that determine where the path ends:

  • if the initial count parameter is non-negative: where the number of outer accessors reaches count.
  • if the initial count parameter is negative: where the class symbol of the type of the reached tree matches toCls.

Attributes

Concrete fields

val ictx: Context

Givens

Givens

given given_Context[Dummy]: Context

The context of all operations of this class

The context of all operations of this class

Attributes