Skip to content

Instantly share code, notes, and snippets.

@xeno-by
Created September 2, 2014 09:43
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 xeno-by/d632787c4626b1b7db23 to your computer and use it in GitHub Desktop.
Save xeno-by/d632787c4626b1b7db23 to your computer and use it in GitHub Desktop.
11:42 ~/Projects/211x/sandbox (2.11.x)$ cat Test.scala
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
import scala.tools.reflect.Eval
object Test extends App {
val tb = cm.mkToolBox(options = "-Ydump-classes .")
println(tb.eval(q"123"))
}
11:42 ~/Projects/211x/sandbox (2.11.x)$ sr
123
11:43 ~/Projects/211x/sandbox (2.11.x)$ ls
Test$.class Test.scala
Test$delayedInit$body.class __wrapper$1$84e521a3b05044d99b3bc578cc89e592
Test.class
11:43 ~/Projects/211x/sandbox (2.11.x)$ ls __wrapper\$1\$84e521a3b05044d99b3bc578cc89e592/
__wrapper$1$84e521a3b05044d99b3bc578cc89e592$.class
__wrapper$1$84e521a3b05044d99b3bc578cc89e592.class
11:43 ~/Projects/211x/sandbox (2.11.x)$ cat Te
Test$.class Test.class
Test$delayedInit$body.class Test.scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment