Dotty Documentation

0.4.0-bin-SNAPSHOT

class InlineLocalObjects
extends Optimisation

Rewrite fields of local instances as vals.

If a local instance does not escape the local scope, it will be removed later by DropNoEffects, thus implementing the equivalent of (local) multi parameter value classes. The main motivation for this transformation is to get ride of the intermediate tuples object somes created when pattern matching on Scala2 case classes.

[-] Constructors

InlineLocalObjects ( simplifyPhase: Simplify )

[-] Members

[+] object NewCaseClassValDef
[+] val candidates : HashSet [ Symbol ]
[+] val gettersCalled : HashSet [ Symbol ]
[+] var newFieldsMapping : Map [ Symbol, LinkedHashMap [ Symbol, Symbol ] ]
[+] val simplifyPhase : Simplify
[+] def clear ( ) : Unit

Clears all the state of this optimisation, to be run last.

[+] def initNewFieldsMapping ( ) ( implicit ctx: Context ) : Unit
[+] def newFieldsMapping_= ( x$1: Map [ Symbol, LinkedHashMap [ Symbol, Symbol ] ] ) : Unit
[+] def transformer ( implicit ctx: Context ) : Tree => Tree

Does the actual Tree => Tree transformation.

[+] def visitor ( implicit ctx: Context ) : Tree => Unit

Gathers information on trees (using mutation), to be run first.