diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-01-31 15:02:48 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-02-01 23:43:32 +0100 |
commit | 610027b3c50c6a46b26bcfe71013cebc172c146b (patch) | |
tree | 6522f581316a4a6b94f004cf2bfbdf34cc481fb2 /test/files/run | |
parent | fbd5efe49cf23b446762dfa5026e8bac82ab04fc (diff) | |
download | scala-610027b3c50c6a46b26bcfe71013cebc172c146b.tar.gz scala-610027b3c50c6a46b26bcfe71013cebc172c146b.tar.bz2 scala-610027b3c50c6a46b26bcfe71013cebc172c146b.zip |
Hardens reification against rare kinds of Constants
Importers now correctly process constants that carry types and symbols.
However, it is still impossible to reify classOf for a class/trait that
is defined inside a quasiquote.
Theoretically, this can be implemented, but will require attaching
original trees to classOf constants, which needs much more effort.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5258a.check | 1 | ||||
-rw-r--r-- | test/files/run/t5258a.scala | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/t5258a.check b/test/files/run/t5258a.check new file mode 100644 index 0000000000..4e0b2da04c --- /dev/null +++ b/test/files/run/t5258a.check @@ -0,0 +1 @@ +int
\ No newline at end of file diff --git a/test/files/run/t5258a.scala b/test/files/run/t5258a.scala new file mode 100644 index 0000000000..deabb8310f --- /dev/null +++ b/test/files/run/t5258a.scala @@ -0,0 +1,14 @@ +import scala.tools.nsc.reporters._ +import scala.tools.nsc.Settings +import reflect.runtime.Mirror.ToolBox + +object Test extends App { + val code = scala.reflect.Code.lift{ + println(classOf[Int]) + }; + + val reporter = new ConsoleReporter(new Settings) + val toolbox = new ToolBox(reporter) + val ttree = toolbox.typeCheck(code.tree) + toolbox.runExpr(ttree) +}
\ No newline at end of file |