diff options
author | Eugene Burmako <burmako@epfl.ch> | 2011-11-28 13:37:52 +0000 |
---|---|---|
committer | Eugene Burmako <burmako@epfl.ch> | 2011-11-28 13:37:52 +0000 |
commit | 4e987a3cf032eb176c20bf3fd5ac847a73b19c00 (patch) | |
tree | 41b2cc06372010f9d30a671d46bf504aa3f9bc05 /test | |
parent | 66bf8db3f115675377d82869fddcab6006adf04d (diff) | |
download | scala-4e987a3cf032eb176c20bf3fd5ac847a73b19c00.tar.gz scala-4e987a3cf032eb176c20bf3fd5ac847a73b19c00.tar.bz2 scala-4e987a3cf032eb176c20bf3fd5ac847a73b19c00.zip |
Reflection toolboxes now respect settings that ...
Reflection toolboxes now respect settings that are provided to them.
Before the fix CompilerCommand lacked the (args, settings, errorFn)
ctor. I added it and provided means to augment passed settings with
custom errorFn.
Closes SI-5239. Review by odersky.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t5239.check | 13 | ||||
-rw-r--r-- | test/files/run/t5239.scala | 20 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/files/run/t5239.check b/test/files/run/t5239.check new file mode 100644 index 0000000000..db5778f95b --- /dev/null +++ b/test/files/run/t5239.check @@ -0,0 +1,13 @@ +result = 2{Int(2)} +[[syntax trees at end of typer]]// Scala source: NoSourceFile +package <empty> { + final object __wrapper$1 extends Object { + def this(): object __wrapper$1 = { + __wrapper$1.super.this(); + () + }; + <static> def wrapper(): Int = 2 + } +} + +evaluated = 2 diff --git a/test/files/run/t5239.scala b/test/files/run/t5239.scala new file mode 100644 index 0000000000..1f404196ba --- /dev/null +++ b/test/files/run/t5239.scala @@ -0,0 +1,20 @@ +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{ + 2 + }; + + val settings = new Settings + settings.Xprint.value = List("typer") + + val reporter = new ConsoleReporter(settings) + val toolbox = new ToolBox(reporter) + val ttree = toolbox.typeCheck(code.tree) + println("result = " + toolbox.showAttributed(ttree)) + + val evaluated = toolbox.runExpr(ttree) + println("evaluated = " + evaluated) +} |