This page is no longer maintained — Please continue to the home page at www.scala-lang.org

powertyper

No replies
adriaanm
Joined: 2010-02-08,
User offline. Last seen 31 weeks 4 days ago.
for those experimenting with the type checker in power mode, here's a small snippet that I hope might help
scala> :power** Power User mode enabled - BEEP BOOP SPIZ **** :phase has been set to 'typer'.          ** ** scala.tools.nsc._ has been imported      **** global._ and definitions._ also imported **** Try  :help,  vals.<tab>,  power.<tab>    **
scala> object dsl extends ast.TreeDSL { val global: intp.global.type = intp.global } defined module dsl
scala> import dsl.CODE._import dsl.CODE._
scala> val typer = analyzer.newTyper(analyzer.rootContext(power.unit("").asInstanceOf[analyzer.global.CompilationUnit])) typer: $r.intp.global.analyzer.Typer = scala.tools.nsc.typechecker.Typers$NormalTyper@6085968b
scala> typer.typed((REF(ListModule) DOT List_apply) APPLY (NULL, NULL))res0: $r.intp.global.analyzer.global.Tree = immutable.this.List.apply[Null](null, null)

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland