The phase defined by this transform
The phase defined by this transform
A standard phase template
A standard phase template
Names of phases that must run before this phase.
Names of phases that must run before this phase.
Name of the phase that this phase must follow immediately.
Name of the phase that this phase must follow immediately.
Is this component enabled? Default is true.
Is this component enabled? Default is true.
SubComponent are added to a HashSet and two phases are the same if they have the same name
SubComponent are added to a HashSet and two phases are the same if they have the same name
True if this phase runs before all other phases.
True if this phase runs before all other phases. Usually, parser
.
True if this phase is not provided by a plug-in.
True if this phase is not provided by a plug-in.
Create a new phase which applies transformer
Create a new phase which applies transformer
The transformer factory
The transformer factory
The phase corresponding to this subcomponent in the current compiler run
The phase corresponding to this subcomponent in the current compiler run
the following two members override abstract members in Transform
the following two members override abstract members in Transform
The following flags may be set by this phase:
The following flags may be set by this phase:
New flags defined by the phase which are not valid until immediately after it
New flags defined by the phase which are not valid until immediately after it
Names of phases required by this component.
Names of phases required by this component. Default is Nil
.
Names of phases that must run after this phase.
Names of phases that must run after this phase. Default is Nil
.
True if this phase runs after all other phases.
True if this phase runs after all other phases. Usually, terminal
.
This phase performs the following functions, each of which could be split out in a mini-phase:
(1) Adds super accessors for all super calls that either appear in a trait or have as a target a member of some outer class.
(2) Converts references to parameter fields that have the same name as a corresponding public parameter field in a superclass to a reference to the superclass field (corresponding = super class field is initialized with subclass field). This info is pre-computed by the
alias
field in Typer.dotc
follows a different route; it computes everything in SuperAccessors and changes the subclass field to a forwarder instead of manipulating references. This is more modular.(3) Adds protected accessors if the access to the protected member happens in a class which is not a subclass of the member's owner.
(4) Mangles the names of class-members which are private up to an enclosing non-package class, in order to avoid overriding conflicts. This is a dubious, and it would be better to deprecate class-qualified privates.
(5) This phase also sets SPECIALIZED flag on type parameters with
@specialized
annotation. We put this logic here because the flag must be set before pickling.It also checks that:
(1) Symbols accessed from super are not abstract, or are overridden by an abstract override.
(2) If a symbol accessed accessed from super is defined in a real class (not a trait), there are no abstract members which override this member in Java's rules (see SI-4989; such an access would lead to illegal bytecode)
(3) Super calls do not go to some synthetic members of Any (see isDisallowed)
(4) Super calls do not go to synthetic field accessors
(5) A class and its companion object do not both define a class or module with the same name.
TODO: Rename phase to "Accessors" because it handles more than just super accessors