Dotty Documentation

0.11.0-bin-SNAPSHOT

abstract class Lifter
extends Object

A class that handles argument lifting. Argument lifting is needed in the following scenarios: - eta expansion - applications with default arguments - applications with out-of-order named arguments Lifting generally lifts impure expressions only, except in the case of possible default arguments, where we lift also complex pure expressions, since in that case arguments can be duplicated as arguments to default argument methods.

[-] Constructors

Lifter ( )

[-] Members

[+] protected def exprLifter : Lifter

The corresponding lifter for pass-by-name arguments

[+] private def lift ( defs: ListBuffer [ Tree ] , expr: Tree , prefix: TermName ) ( implicit ctx: Context ) : Tree
[+] private def lift$default$3 : TermName
[+] def liftApp ( defs: ListBuffer [ Tree ] , tree: Tree ) ( implicit ctx: Context ) : Tree

Lift out function prefix and all arguments from application

pre.f(arg1, ..., argN) becomes

val x0 = pre val x1 = arg1 ... val xN = argN x0.f(x1, ..., xN)

But leave pure expressions alone.

[+] private def liftArg ( defs: ListBuffer [ Tree ] , arg: Tree , prefix: TermName ) ( implicit ctx: Context ) : Tree

Lift a function argument, stripping any NamedArg wrapper

[+] private def liftArg$default$3 : TermName

Lift a function argument, stripping any NamedArg wrapper

[+] def liftArgs ( defs: ListBuffer [ Tree ] , methRef: Type , args: List [ Tree ] ) ( implicit ctx: Context ) : List [ Tree ]

Lift arguments that are not-idempotent into ValDefs in buffer defs and replace by the idents of so created ValDefs.

[+] def liftAssigned ( defs: ListBuffer [ Tree ] , tree: Tree ) ( implicit ctx: Context ) : Tree

Lift out common part of lhs tree taking part in an operator assignment such as

lhs += expr

[+] def liftPrefix ( defs: ListBuffer [ Tree ] , tree: Tree ) ( implicit ctx: Context ) : Tree

Lift prefix pre of an application pre.f(...) to

val x0 = pre x0.f(...)

unless pre is a New or pre is idempotent.

[+] protected def liftedDef ( sym: TermSymbol , rhs: Tree ) ( implicit ctx: Context ) : MemberDef

The tree of a lifted definition

[+] protected def liftedFlags : FlagSet

The flags of a lifted definition

[+] def noLift ( expr: Tree ) ( implicit ctx: Context ) : Boolean

Test indicating expr does not need lifting