class Memoize
extends MiniPhaseTransform with IdentityDenotTransformer

Provides the implementations of all getters and setters, introducing fields to hold the value accessed by them. TODO: Make LazyVals a part of this phase?

def x(): T = e --> private val x: T = e def x(): T = x

def x(): T = e --> private var x: T = e def x(): T = x

def x_=(y: T): Unit = () --> def x_=(y: T): Unit = x = y

Constructors

Memoize ( )

Members

[+] override def checkPostCondition ( tree: Tree ) ( implicit ctx: Context ) : Unit

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.

[+] 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
[+] override def runsAfter : Set [ Class [ Nothing <: Phase ] ]

Should run after mixin so that fields get generated in the class that contains the concrete getter rather than the trait that defines it.

Should run after mixin so that fields get generated in the class that contains the concrete getter rather than the trait that defines it.

[+] override def transformDefDef ( tree: DefDef ) ( implicit ctx: Context , info: TransformerInfo ) : Tree