Dotty Documentation

0.12.0-bin-SNAPSHOT

class RefChecks
extends MiniPhase

Post-attribution checking and transformation, which fulfills the following roles

  1. This phase performs the following checks.
  • only one overloaded alternative defines default arguments
  • applyDynamic methods are not overloaded
  • all overrides conform to rules laid down by checkAllOverrides.
  • any value classes conform to rules laid down by checkDerivedValueClass.
  • this(...) constructor calls do not forward reference other definitions in their block (not even lazy vals).
  • no forward reference in a local block jumps over a non-lazy val definition.
  • a class and its companion object do not both define a class or module with the same name.
  1. It warns about references to symbols labeled deprecated or migration.

  2. It eliminates macro definitions.

  3. It makes members not private where necessary. The following members cannot be private in the Java model:
    • term members of traits
    • the primary constructor of a value class
    • the parameter accessor of a value class
    • members accessed from an inner or companion class. All these members are marked as NotJavaPrivate. Unlike in Scala 2.x not-private members keep their name. It is up to the backend to find a unique expanded name for them. The rationale to do name changes that late is that they are very fragile.

todo: But RefChecks is not done yet. It's still a somewhat dirty port from the Scala 2 version. todo: move untrivial logic to their own mini-phases

[-] Constructors

RefChecks ( )

[-] Members

[+] private var LevelInfo : Location [ OptLevelInfo ]
[+] private def LevelInfo_= ( x$1: Location [ OptLevelInfo ] ) : Unit
[+] private def currentLevel ( implicit ctx: Context ) : OptLevelInfo
[+] override def initContext ( ctx: FreshContext ) : Unit
[+] 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:

$ ./bin/dotc -Xprint:<phaseNameHere> sourceFile.scala
[+] override def prepareForStats ( trees: List [ Tree ] ) ( implicit ctx: Context ) : Context
[+] override def runsAfter : Set [ String ]

List of names of phases that should precede this phase

[+] override def transformApply ( tree: Apply ) ( implicit ctx: Context ) : Apply
[+] override def transformDefDef ( tree: DefDef ) ( implicit ctx: Context ) : DefDef
[+] override def transformIdent ( tree: Ident ) ( implicit ctx: Context ) : Ident
[+] override def transformNew ( tree: New ) ( implicit ctx: Context ) : New
[+] override def transformSelect ( tree: Select ) ( implicit ctx: Context ) : Select
[+] override def transformTemplate ( tree: Template ) ( implicit ctx: Context ) : Tree
[+] override def transformValDef ( tree: ValDef ) ( implicit ctx: Context ) : ValDef