diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-02-05 14:26:42 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-02-05 16:52:14 +0100 |
commit | f914350f8f5fecce7350a4c7e1a6c2fe447c7324 (patch) | |
tree | 0d5def1e3a0c39bf896ef1b05bcb5c290fe362e9 /test/files/run | |
parent | ffc2389840852a120fecd772206d55db9a79f30e (diff) | |
download | scala-f914350f8f5fecce7350a4c7e1a6c2fe447c7324.tar.gz scala-f914350f8f5fecce7350a4c7e1a6c2fe447c7324.tar.bz2 scala-f914350f8f5fecce7350a4c7e1a6c2fe447c7324.zip |
Fixes https://issues.scala-lang.org/browse/SI-5272
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t5272_1.check | 1 | ||||
-rw-r--r-- | test/files/run/t5272_1.scala | 17 | ||||
-rw-r--r-- | test/files/run/t5272_2.check | 1 | ||||
-rw-r--r-- | test/files/run/t5272_2.scala | 16 |
4 files changed, 35 insertions, 0 deletions
diff --git a/test/files/run/t5272_1.check b/test/files/run/t5272_1.check new file mode 100644 index 0000000000..9f8d6f24e7 --- /dev/null +++ b/test/files/run/t5272_1.check @@ -0,0 +1 @@ +okay
\ No newline at end of file diff --git a/test/files/run/t5272_1.scala b/test/files/run/t5272_1.scala new file mode 100644 index 0000000000..3f44d05fb3 --- /dev/null +++ b/test/files/run/t5272_1.scala @@ -0,0 +1,17 @@ +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 match { + case 2 => println("okay") + case _ => println("not okay") + } + }; + + val reporter = new ConsoleReporter(new Settings) + val toolbox = new ToolBox(reporter) + val ttree = toolbox.typeCheck(code.tree) + toolbox.runExpr(ttree) +} diff --git a/test/files/run/t5272_2.check b/test/files/run/t5272_2.check new file mode 100644 index 0000000000..549f3f3af8 --- /dev/null +++ b/test/files/run/t5272_2.check @@ -0,0 +1 @@ +okay2
\ No newline at end of file diff --git a/test/files/run/t5272_2.scala b/test/files/run/t5272_2.scala new file mode 100644 index 0000000000..833ee65285 --- /dev/null +++ b/test/files/run/t5272_2.scala @@ -0,0 +1,16 @@ +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 match { + case x => println("okay" + x) + } + }; + + val reporter = new ConsoleReporter(new Settings) + val toolbox = new ToolBox(reporter) + val ttree = toolbox.typeCheck(code.tree) + toolbox.runExpr(ttree) +} |