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.
The sequence position of this phase in the given context where 0 is reserved for NoPhase and the first real phase is at position 1.
The sequence position of this phase in the given context where 0 is reserved for NoPhase and the first real phase is at position 1. -1 if the phase is not installed in the context.
id of this mini phase in group
id of this mini phase in group
Output should be checkable by TreeChecker
Output should be checkable by TreeChecker
Is this phase the standard typerphase? True for FrontEnd, but not for other first phases (such as FromTasty).
Is this phase the standard typerphase? True for FrontEnd, but not for other first phases (such as FromTasty). The predicate is tested in some places that perform checks and corrections. It's different from isAfterTyper (and cheaper to test).
The last phase during which the transformed denotations are valid
The last phase during which the transformed denotations are valid
If set, allow missing or superfluous arguments in applications and type applications.
If set, allow missing or superfluous arguments in applications and type applications.
List of names of phases that should precede this phase
List of names of phases that should have finished their processing of all compilation units before this phase starts
List of names of phases that should have finished their processing of all compilation units before this phase starts
The transformation method
The transformation method
Transform tree using all transforms of current group (including this one)
Transform tree using all transforms of current group (including this one)
Transform single node using all transforms following the current one in this group
Transform single node using all transforms following the current one in this group
Transform subtree using all transforms following the current one in this group
Transform subtree using all transforms following the current one in this group
Throws an UnsupportedOperationException
with the given method name.
Throws an UnsupportedOperationException
with the given method name.
The validity period of the transformer in the given context
The validity period of the transformer in the given context
This phase performs the following transformations:
traitDefs
andtransformSym
) Map every concrete trait getter<mods> def x(): T = expr
to the pair of definitions:
<mods> def x(): T protected def initial$x(): T = { stats; expr }
where
stats
comprises all statements between either the start of the trait or the previous field definition which are not definitions (i.e. are executed for their side effects).2. (done in
traitDefs
) Make every concrete trait setter<mods> def x_=(y: T) = ()
deferred by mapping it to
<mods> def x_=(y: T)
3. For a non-trait class C:
For every trait M directly implemented by the class (see SymUtils.mixin), in reverse linearization order, add the following definitions to C:
3.1 (done in
traitInits
) For every parameter accessor<mods> def x(): T
in M, in order of textual occurrence, add<mods> def x() = e
where
e
is the constructor argument in C that corresponds tox
. Issue an error if no such argument exists.3.2 (done in
traitInits
) For every concrete trait getter<mods> def x(): T
in M which is not a parameter accessor, in order of textual occurrence, produce the following:3.2.1 If
x
is also a member ofC
, and M is a Dotty trait:<mods> def x(): T = super[M].initial$x()
3.2.2 If
x
is also a member ofC
, and M is a Scala 2.x trait:<mods> def x(): T = _
3.2.3 If
x
is not a member ofC
, and M is a Dotty trait:super[M].initial$x()
3.2.4 If
x
is not a member ofC
, and M is a Scala2.x trait, nothing gets added.3.3 (done in
superCallOpt
) The call:super[M].<init>
3.4 (done in
setters
) For every concrete setter<mods> def x_=(y: T)
in M:<mods> def x_=(y: T) = ()
4. (done in
transformTemplate
andtransformSym
) Drop all parameters from trait constructors.5. (done in
transformSym
) Drop ParamAccessor flag from all parameter accessors in traits.Conceptually, this is the second half of the previous mixin phase. It needs to run after erasure because it copies references to possibly private inner classes and objects into enclosing classes where they are not visible. This can only be done if all references are symbolic.