Skip to content

Instantly share code, notes, and snippets.

@4e6
Last active December 10, 2015 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4e6/4388011 to your computer and use it in GitHub Desktop.
Save 4e6/4388011 to your computer and use it in GitHub Desktop.
//import scala.reflect.runtime.universe._
import scala.reflect.runtime.{ currentMirror => m }
import scala.tools.reflect.ToolBox
import scala.tools.reflect.Eval
object Test extends App {
val tb = m.mkToolBox(options = "-Xprint:typer -Yshow-trees -Ydebug -Ytyper-debug")
class O { class I }
class A extends O {
val code = tb.u.reify {
val v: I = new I
v
}
println(tb.u.showRaw(code))
}
tb.eval((new A).code.tree)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment