class FirstTransform
extends MiniPhaseTransform with InfoTransformer with AnnotationTransformer

The first tree transform - ensures there are companion objects for all classes except module classes - eliminates some kinds of trees: Imports, NamedArgs - stubs out native methods - eliminates self tree in Template and self symbol in ClassInfo - collapsess all type trees to trees of class TypeTree - converts idempotent expressions with constant types

Constructors

FirstTransform ( )

Members

[+] private var addCompanionPhases : List [ NeedsCompanions ]
[+] private def addCompanionPhases_= ( x$1: List [ NeedsCompanions ] ) : Unit
[+] override def checkPostCondition ( tree: Tree ) ( implicit ctx: Context ) : Unit

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

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

[+] def needsCompanion ( cls: ClassSymbol ) ( implicit ctx: Context ) : Boolean
[+] private def newCompanion ( name: TermName , forClass: Symbol ) ( implicit ctx: Context ) : ( TermSymbol, Symbol, Symbol )
[+] 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:

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
[+] override def prepareForUnit ( tree: Tree ) ( implicit ctx: Context ) : TreeTransform
[+] private def reorderAndComplete ( stats: List [ Tree ] ) ( implicit ctx: Context ) : List [ Tree ]

Reorder statements so that module classes always come after their companion classes, add missing companion classes

Reorder statements so that module classes always come after their companion classes, add missing companion classes

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

eliminate self symbol in ClassInfo

eliminate self symbol in ClassInfo

[+] override def transformOther ( tree: Tree ) ( implicit ctx: Context , info: TransformerInfo ) : Tree
[+] override def transformSelect ( tree: Select ) ( implicit ctx: Context , info: TransformerInfo ) : Tree
[+] override def transformStats ( trees: List [ Tree ] ) ( implicit ctx: Context , info: TransformerInfo ) : List [ Tree ]
[+] override def transformTemplate ( impl: Template ) ( implicit ctx: Context , info: TransformerInfo ) : Tree

elimiate self in Template

elimiate self in Template

[+] override def transformTypeApply ( tree: TypeApply ) ( implicit ctx: Context , info: TransformerInfo ) : Tree
[+] override def transformTyped ( tree: Typed ) ( implicit ctx: Context , info: TransformerInfo ) : Tree