class
ExpandSAMs
extends
MiniPhaseTransform
Expand SAM closures that cannot be represented by the JVM as lambdas to anonymous classes. These fall into five categories
- Partial function closures, we need to generate a isDefinedAt method for these.
- Closures implementing non-trait classes.
- Closures implementing classes that inherit from a class other than Object (a lambda cannot not be a run-time subtype of such a class)
- Closures that implement traits which run initialization code.
- Closures that get synthesized abstract methods in the transformation pipeline. These methods can be (1) superaccessors, (2) outer references, (3) accessors for fields.
Constructors
ExpandSAMs
(
)
Members
Is the SAMType cls
also a SAM under the rules of the platform?
Is the SAMType cls
also a SAM under the rules of the platform?
override
def
phaseName
: String
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:
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