powertyper

68 views
Skip to first unread message

Adriaan Moors

unread,
Nov 29, 2011, 5:27:20 AM11/29/11
to scala-i...@googlegroups.com
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)


Reply all
Reply to author
Forward
0 new messages