scala.tools.nsc.transform.ExplicitOuter

ExplicitOuterTransformer

class ExplicitOuterTransformer extends OuterPathTransformer

The phase performs the following transformations on terms:

-

An class which is not an interface and is not static gets an outer accessor (@see outerDefs).

1a. A class which is not a trait gets an outer field.

- A constructor of a non-trait inner class gets an outer parameter.

- A reference C.this where C refers to an outer class is replaced by a selection this.$outer$$C1 ... .$outer$$Cn (@see outerPath)

-

- A call to a constructor Q.<init>(args) or Q.$init$(args) where Q != this and the constructor belongs to a non-static class is augmented by an outer argument. E.g. Q.<init>(OUTER, args) where OUTER is the qualifier corresponding to the singleton type Q.

- A call to a constructor this.<init>(args) in a secondary constructor is augmented to this.<init>(OUTER, args) where OUTER is the last parameter of the secondary constructor.

- Remove private modifier from class members M that are accessed from an inner class.

- Remove protected modifier from class members M that are accessed without a super qualifier accessed from an inner class or trait.

- Remove private and protected modifiers from type symbols

- Remove private modifiers from members of traits

Note: The whole transform is run in phase explicitOuter.next.

Self Type
ExplicitOuterTransformer
Source
ExplicitOuter.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ExplicitOuterTransformer
  2. OuterPathTransformer
  3. TypingTransformer
  4. Transformer
  5. Transformer
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExplicitOuterTransformer(unit: CompilationUnit)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def atOwner[A](tree: Tree, owner: Symbol)(trans: ⇒ A): A

    Definition Classes
    TypingTransformer
  8. def atOwner[A](owner: Symbol)(trans: ⇒ A): A

    Definition Classes
    TypingTransformer → Transformer
  9. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. var curTree: Tree

    Attributes
    protected
    Definition Classes
    TypingTransformer
  11. def currentClass: Symbol

    Attributes
    protected
    Definition Classes
    Transformer
  12. def currentMethod: Symbol

    Attributes
    protected
    Definition Classes
    Transformer
  13. var currentOwner: Symbol

    Attributes
    protected
    Definition Classes
    Transformer
  14. def currentPackage: Symbol

    Attributes
    protected
    Definition Classes
    Transformer
  15. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. var localTyper: Typer

    Definition Classes
    TypingTransformer
  22. def matchTranslation(tree: Match): Tree

  23. def mixinOuterAccessorDef(mixinClass: Symbol): Tree

    The definition tree of the outer accessor for class mixinClass.

    The definition tree of the outer accessor for class mixinClass.

    mixinClass

    The mixin class which defines the abstract outer accessor which is implemented by the generated one.

  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def outerAccessorDef: Tree

    The definition tree of the outer accessor of current class

  28. def outerFieldDef: Tree

    The definition tree of the outer accessor of current class

  29. var outerParam: Symbol

    The directly enclosing outer parameter, if we are in a constructor

    The directly enclosing outer parameter, if we are in a constructor

    Attributes
    protected
    Definition Classes
    OuterPathTransformer
  30. def outerPath(base: Tree, from: Symbol, to: Symbol): Tree

    The path

    `base'.$outer$$C1 ... .$outer$$Cn
    
    which refers to the outer instance of class to of value base.

    The path

    `base'.$outer$$C1 ... .$outer$$Cn
    
    which refers to the outer instance of class to of value base. The result is typed but not positioned.

    base'.$outer$$C1 ... .$outer$$Cn which refers to the outer instance of class to of value base. The result is typed but not positioned.

    base

    ...

    from

    ...

    to

    ...

    returns

    ...

    Attributes
    protected
    Definition Classes
    OuterPathTransformer
  31. def outerValue: Tree

    The first outer selection from currently transformed tree.

    The first outer selection from currently transformed tree. The result is typed but not positioned.

    Attributes
    protected
    Definition Classes
    OuterPathTransformer
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    AnyRef → Any
  34. def transform(tree: Tree): Tree

    The main transformation method

    The main transformation method

    Definition Classes
    ExplicitOuterTransformerOuterPathTransformerTypingTransformer → Transformer
  35. def transformCaseDefs(trees: List[CaseDef]): List[CaseDef]

    Definition Classes
    Transformer
  36. def transformIdents(trees: List[Ident]): List[Ident]

    Definition Classes
    Transformer
  37. def transformModifiers(mods: Modifiers): Modifiers

    Definition Classes
    Transformer
  38. def transformStats(stats: List[Tree], exprOwner: Symbol): List[Tree]

    Definition Classes
    Transformer
  39. def transformTemplate(tree: Template): Template

    Definition Classes
    Transformer
  40. def transformTrees(trees: List[Tree]): List[Tree]

    Definition Classes
    Transformer
  41. def transformTypeDefs(trees: List[TypeDef]): List[TypeDef]

    Definition Classes
    Transformer
  42. def transformUnit(unit: CompilationUnit): Unit

    The transformation method for whole compilation units

    The transformation method for whole compilation units

    Definition Classes
    ExplicitOuterTransformerTransformer
  43. def transformValDef(tree: ValDef): ValDef

    Definition Classes
    Transformer
  44. def transformValDefs(trees: List[ValDef]): List[ValDef]

    Definition Classes
    Transformer
  45. def transformValDefss(treess: List[List[ValDef]]): List[List[ValDef]]

    Definition Classes
    Transformer
  46. val treeCopy: TreeCopier

    Definition Classes
    Transformer
  47. def typedPos(pos: Position)(tree: Tree): Tree

    Attributes
    protected
    Definition Classes
    TypingTransformer
  48. val typers: Map[Symbol, Typer]

    a typer for each enclosing class

    a typer for each enclosing class

    Definition Classes
    TypingTransformer
  49. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  50. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  51. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from OuterPathTransformer

Inherited from TypingTransformer

Inherited from Transformer

Inherited from Transformer

Inherited from AnyRef

Inherited from Any