Setup

dotty.tools.dotc.cc.Setup
See theSetup companion object
class Setup(preRecheckPhase: DenotTransformer, thisPhase: DenotTransformer, recheckDef: (ValOrDefDef, Symbol) => Context ?=> Unit) extends TreeTraverser

A tree traverser that prepares a compilation unit to be capture checked. It does the following:

  • For every inferred type, drop any retains annotations, add capture sets to all its parts, add refinements to class types and function types. (c.f. mapInferred)
  • For explicit capturing types, expand throws aliases to the underlying (pure) function, and add some implied capture sets to curried functions (c.f. expandThrowsAlias, expandAbbreviations).
  • Add capture sets to self types of classes and objects, unless the self type was written explicitly.
  • Box the types of mutable variables and type arguments to methods (type arguments of types are boxed on access).
  • Link the external types of val and def symbols with the inferred types based on their parameter symbols.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

object throwsAlias

Recognizer for res $throws exc, returning (res, exc) in case of success

Recognizer for res $throws exc, returning (res, exc) in case of success

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def addVar(tp: Type, owner: Symbol, mapRoots: Boolean)(using Context): Type

Add a capture set variable to tp if necessary, or maybe pull out an embedded capture set variable from a part of tp.

Add a capture set variable to tp if necessary, or maybe pull out an embedded capture set variable from a part of tp.

Attributes

override def apply(x: Unit, trees: List[Tree])(using Context): Unit

Attributes

Definition Classes
def apply(tree: Tree)(using Context): Unit
def decorate(tp: Type, mapRoots: Boolean, addedSet: Type => CaptureSet)(using Context): Type

Add a capture set variable to tp if necessary, or maybe pull out an embedded capture set variable from a part of tp.

Add a capture set variable to tp if necessary, or maybe pull out an embedded capture set variable from a part of tp.

Attributes

def needsVariable(tp: Type)(using Context): Boolean

Should a capture set variable be added on type tp?

Should a capture set variable be added on type tp?

Attributes

def newOwnerFor(sym: Symbol)(using Context): Symbol | Null

If the outer context directly enclosing the definition of sym has a owner, that owner, otherwise null.

If the outer context directly enclosing the definition of sym has a owner, that owner, otherwise null.

Attributes

def normalizeCaptures(tp: Type)(using Context): Type

Pull out an embedded capture set from a part of tp

Pull out an embedded capture set from a part of tp

Attributes

def postProcess(tree: Tree)(using Context): Unit
def traverse(tree: Tree)(using Context): Unit

Inherited methods

def apply(x: Unit, tree: Tree)(using Context): Unit

Attributes

Inherited from:
TreeTraverser
def foldMoreCases(x: Unit, tree: Tree)(using Context): Unit

Attributes

Inherited from:
TreeAccumulator
def foldOver(x: Unit, tree: Tree)(using Context): Unit

Attributes

Inherited from:
TreeAccumulator
def traverse(trees: List[Tree])(using Context): Unit

Attributes

Inherited from:
TreeTraverser
protected def traverseChildren(tree: Tree)(using Context): Unit

Attributes

Inherited from:
TreeTraverser

Extensions

Extensions

extension (sym: Symbol)
extension (tp: Type)