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
eliminate self symbol in ClassInfo
Eliminate empty package definitions that may have been stored in the TASTY trees