ExplicitOuter

dotty.tools.dotc.transform.ExplicitOuter$
See theExplicitOuter companion class
object ExplicitOuter

Attributes

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

Members list

Type members

Classlikes

final class OuterOps(val ictx: Context) extends AnyVal

The operations in this class

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

Supertypes
class AnyVal
trait Matchable
class Any

Value members

Concrete methods

Ensure that class cls has outer accessors

Ensure that class cls has outer accessors

Attributes

Class needs an outer pointer, provided there is a reference to an outer this in it.

Class needs an outer pointer, provided there is a reference to an outer this in it.

Attributes

Class constructor needs an outer argument. Can be called only after phase ExplicitOuter.

Class constructor needs an outer argument. Can be called only after phase ExplicitOuter.

Attributes

def outer(using Context): OuterOps

The outer accessor of class cls. To find it is a bit tricky. The class might have been moved with new owners between ExplicitOuter and Erasure, where the method is also called. For instance, it might have been part of a by-name argument, and therefore be moved under a closure method by ElimByName. In that case looking up the method again at Erasure with the fully qualified name outerAccName will fail, because the outerAccName's result is phase dependent. In that case we use a backup strategy where we search all definitions in the class to find the one with the OuterAccessor flag.

The outer accessor of class cls. To find it is a bit tricky. The class might have been moved with new owners between ExplicitOuter and Erasure, where the method is also called. For instance, it might have been part of a by-name argument, and therefore be moved under a closure method by ElimByName. In that case looking up the method again at Erasure with the fully qualified name outerAccName will fail, because the outerAccName's result is phase dependent. In that case we use a backup strategy where we search all definitions in the class to find the one with the OuterAccessor flag.

Attributes

def referencesOuter(cls: Symbol, tree: Tree)(using Context): Boolean

Tree references an outer class of cls which is not a static owner.

Tree references an outer class of cls which is not a static owner.

Attributes

Concrete fields

val name: String

Extensions

Extensions

extension (sym: Symbol)(sym: Symbol)