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
Denotations with a symbol where mayChange
is false are guaranteed to be
unaffected by this transform, so transformInfo
need not be run.
Denotations with a symbol where mayChange
is false are guaranteed to be
unaffected by this transform, so transformInfo
need not be run. This
can save time, and more importantly, can help avoid forcing symbol completers.
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 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 eliminates ExprTypes
=> T
as types of function parameters, and replaces them by nullary function types. More precisely:For the types of parameter symbols:
> T
Note that
=> T
types are not eliminated in MethodTypes. This is done later at erasure. Terms are rewritten as follows:x ==> x.apply() if x is a parameter that had type => T
Arguments to call-by-name parameters are translated as follows. First, the argument is rewritten by the rules
e.apply() ==> e if e.apply() is an argument to a call-by-name parameter expr ==> () => expr if other expr is an argument to a call-by-name parameter
This makes the argument compatible with a parameter type of () => T, which will be the formal parameter type at erasure. But to be -Ycheckable until then, any argument ARG rewritten by the rules above is again wrapped in an application DummyApply(ARG) where
DummyApply: [T](() => T): T
is a synthetic method defined in Definitions. Erasure will later strip these DummyApply wrappers.
Note: This scheme to have inconsistent types between method types (whose formal types are still ExprTypes and parameter valdefs (which are now FunctionTypes) is not pretty. There are two other options which have been abandoned or not yet pursued.
Option 1: Transform => T to () => T also in method and function types. The problem with this is that is that it requires to look at every type, and this forces too much, causing Cyclic Reference errors. Abandoned for this reason.
Option 2: Merge ElimByName with erasure, or have it run immediately before. This has not been tried yet.