Dotty Documentation

0.9.0-bin-SNAPSHOT

class FirstTransform
extends MiniPhase with InfoTransformer

The first tree transform - eliminates some kinds of trees: Imports, NamedArgs - stubs out native methods - eliminates self tree in Template and self symbol in ClassInfo - collapses all type trees to trees of class TypeTree - converts idempotent expressions with constant types - drops branches of ifs using the rules if (true) A else B ==> A if (false) A else B ==> B

[-] Constructors

FirstTransform ( )

[-] Members

[+] private object collectBinders
[+] override def checkPostCondition ( tree: Tree ) ( implicit ctx: Context ) : Unit

Check what the phase achieves, to be called at any point after it is finished.

[+] private def foldCondition ( tree: Apply ) ( implicit ctx: Context ) : Tree [ Type ]
[+] protected override def mayChange ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

Denotations with a symbol where mayChange is false are guaranteed to be unaffected by this transform, so transformInfo need not be run. This can save time, and more importantly, can help avoid forcing symbol completers.

[+] override def phaseName : String

A name given to the Phase that can be used to debug the compiler. For instance, it is possible to print trees after a given phase using:

$ ./bin/dotc -Xprint:<phaseNameHere> sourceFile.scala
[+] private def reorderAndComplete ( stats: List [ Tree ] ) ( implicit ctx: Context ) : List [ Tree ]

Reorder statements so that module classes always come after their companion classes

[+] private def toTypeTree ( tree: Tree ) ( implicit ctx: Context ) : Tree [ Type ]

Replace type tree t of type T with TypeTree(T), but record all nested Bind nodes in annotations. These are interpreted in TreeTypeMaps so that bound symbols can be properly copied.

[+] override def transformApply ( tree: Apply ) ( implicit ctx: Context ) : Tree
[+] override def transformBlock ( tree: Block ) ( implicit ctx: Context ) : Tree
[+] override def transformDefDef ( ddef: DefDef ) ( implicit ctx: Context ) : Tree
[+] override def transformIdent ( tree: Ident ) ( implicit ctx: Context ) : Tree
[+] override def transformIf ( tree: If ) ( implicit ctx: Context ) : Tree
[+] override def transformInfo ( tp: Type , sym: Symbol ) ( implicit ctx: Context ) : Type

eliminate self symbol in ClassInfo

[+] override def transformOther ( tree: Tree ) ( implicit ctx: Context ) : Tree
[+] override def transformSelect ( tree: Select ) ( implicit ctx: Context ) : Tree
[+] override def transformStats ( trees: List [ Tree ] ) ( implicit ctx: Context ) : List [ Tree ]
[+] override def transformTemplate ( impl: Template ) ( implicit ctx: Context ) : Tree
[+] override def transformTypeApply ( tree: TypeApply ) ( implicit ctx: Context ) : Tree
[+] override def transformTyped ( tree: Typed ) ( implicit ctx: Context ) : Tree