Dotty Documentation

0.3.0-bin-SNAPSHOT

class TreeChecker
extends DotClass with Phase with SymTransformer

Run by -Ycheck option after a given phase, this class retypes all syntax trees and verifies that the type of each tree node so obtained conforms to the type found in the tree node. It also performs the following checks:

  • The owner of each definition is the same as the owner of the current typing context.
  • Ident nodes do not refer to a denotation that would need a select to be accessible (see tpd.needsSelect).
  • After typer, identifiers and select nodes refer to terms only (all types should be represented as TypeTrees then).

[-] Constructors

TreeChecker ( )

[-] Members

[+] class Checker
[+] val NoSuperClass : FlagSet
[+] private val seenClasses : HashMap [ String, Symbol ]
[+] private val seenModuleVals : HashMap [ String, Symbol ]
[+] def assertSelectWrapsNew ( tree: Tree ) ( implicit ctx: Context ) : Unit

Checks that New nodes are always wrapped inside Select nodes.

[+] def check ( phasesToRun: Seq [ Phase ] , ctx: Context ) : Tree
[+] def checkCompanion ( symd: SymDenotation ) ( implicit ctx: Context ) : Unit
[+] def isValidJVMMethodName ( name: Name ) : Boolean
[+] def isValidJVMName ( name: Name ) : Boolean
[+] 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
[+] private def previousPhases ( phases: List [ Phase ] ) ( implicit ctx: Context ) : List [ Phase ]
[+] def printError ( str: String ) ( implicit ctx: Context ) : Unit
[+] def run ( implicit ctx: Context ) : Unit
[+] def testDuplicate ( sym: Symbol , registry: Map [ String, Symbol ] , typ: String ) ( implicit ctx: Context ) : Unit
[+] def transformSym ( symd: SymDenotation ) ( implicit ctx: Context ) : SymDenotation