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 - 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
Can this transform create or delete non-private members?
Check what the phase achieves, to be called at any point after it is finished.
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
Reorder statements so that module classes always come after their companion classes, add missing companion classes
Replace type tree
t of type
TypeTree(T), but record all
nested Bind nodes in annotations. These are interpreted in TreeTypeMaps
so that bound symbols can be properly copied.
eliminate self symbol in ClassInfo
Eliminate empty package definitions that may have been stored in the TASTY trees