Dotty Documentation


class HoistSuperArgs
extends MiniPhaseTransform with IdentityDenotTransformer

This phase hoists complex arguments of supercalls and this-calls out of the enclosing class. Example:

class B(y: Int) extends A({ def f(x: Int) = x * x; f(y)})

is translated to

class B(y: Int) extends A(B#B$superArg$1(this.y)) {
  private <static> def B$superArg$1(y: Int): Int = {
    def f(x: Int): Int = x.*(x); f(y)

An argument is complex if it contains a method or template definition, a this or a new, or it contains an identifier which needs a this prefix to be accessed. This is the case if the identifer neither a global reference nor a reference to a parameter of the enclosing class.

[-] Constructors

HoistSuperArgs ( )

[-] Members

[+] class Hoister

Defines methods for hoisting complex supercall arguments out of parent super calls and constructor definitions. Hoisted superarg methods are collected in superArgDefs

[+] 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:

$ ./bin/dotc -Xprint:<phaseNameHere> sourceFile.scala
[+] override def runsAfter : Set [ Class [ Nothing <: Phase ] ]

List of names of phases that should precede this phase

[+] override def transformTypeDef ( tdef: TypeDef ) ( implicit ctx: Context , info: TransformerInfo ) : Tree