summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-02-14 00:05:18 +0100
committerEugene Burmako <xeno.by@gmail.com>2012-02-14 20:58:43 +0100
commitf6174691647bb1fae7e86d53790b1e540b890755 (patch)
treed5bfae16a8c494e3a6757ba1bca02fc4ad3b4c3b /test/files/run
parenta2ce52f838d7ae4a1af93e5149e38ef87e9cd06d (diff)
downloadscala-f6174691647bb1fae7e86d53790b1e540b890755.tar.gz
scala-f6174691647bb1fae7e86d53790b1e540b890755.tar.bz2
scala-f6174691647bb1fae7e86d53790b1e540b890755.zip
Preprocessing for reifees
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t5271_1.check0
-rw-r--r--test/files/run/t5271_1.scala14
-rw-r--r--test/files/run/t5271_2.check1
-rw-r--r--test/files/run/t5271_2.scala16
-rw-r--r--test/files/run/t5271_3.check1
-rw-r--r--test/files/run/t5271_3.scala17
-rw-r--r--test/files/run/t5271_4.check0
-rw-r--r--test/files/run/t5271_4.scala14
-rw-r--r--test/files/run/t5273_1.check1
-rw-r--r--test/files/run/t5273_1.scala17
-rw-r--r--test/files/run/t5273_2a.check1
-rw-r--r--test/files/run/t5273_2a.scala15
-rw-r--r--test/files/run/t5273_2b.check1
-rw-r--r--test/files/run/t5273_2b.scala16
-rw-r--r--test/files/run/t5276_1a.check1
-rw-r--r--test/files/run/t5276_1a.scala15
-rw-r--r--test/files/run/t5276_1b.check1
-rw-r--r--test/files/run/t5276_1b.scala15
-rw-r--r--test/files/run/t5276_2a.check1
-rw-r--r--test/files/run/t5276_2a.scala18
-rw-r--r--test/files/run/t5276_2b.check1
-rw-r--r--test/files/run/t5276_2b.scala19
22 files changed, 185 insertions, 0 deletions
diff --git a/test/files/run/t5271_1.check b/test/files/run/t5271_1.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/t5271_1.check
diff --git a/test/files/run/t5271_1.scala b/test/files/run/t5271_1.scala
new file mode 100644
index 0000000000..5f10e64528
--- /dev/null
+++ b/test/files/run/t5271_1.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{
+ case class C(foo: Int, bar: Int)
+ };
+
+ 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/t5271_2.check b/test/files/run/t5271_2.check
new file mode 100644
index 0000000000..b8626c4cff
--- /dev/null
+++ b/test/files/run/t5271_2.check
@@ -0,0 +1 @@
+4
diff --git a/test/files/run/t5271_2.scala b/test/files/run/t5271_2.scala
new file mode 100644
index 0000000000..71967c04ed
--- /dev/null
+++ b/test/files/run/t5271_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{
+ case class C(foo: Int, bar: Int)
+ val c = C(2, 2)
+ println(c.foo * c.bar)
+ };
+
+ 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/t5271_3.check b/test/files/run/t5271_3.check
new file mode 100644
index 0000000000..f32a5804e2
--- /dev/null
+++ b/test/files/run/t5271_3.check
@@ -0,0 +1 @@
+true \ No newline at end of file
diff --git a/test/files/run/t5271_3.scala b/test/files/run/t5271_3.scala
new file mode 100644
index 0000000000..bfa116c691
--- /dev/null
+++ b/test/files/run/t5271_3.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{
+ object C { def qwe = 4 }
+ case class C(foo: Int, bar: Int)
+ val c = C(2, 2)
+ println(c.foo * c.bar == C.qwe)
+ };
+
+ 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/t5271_4.check b/test/files/run/t5271_4.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/t5271_4.check
diff --git a/test/files/run/t5271_4.scala b/test/files/run/t5271_4.scala
new file mode 100644
index 0000000000..e5e16033e8
--- /dev/null
+++ b/test/files/run/t5271_4.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{
+ case object C
+ };
+
+ 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/t5273_1.check b/test/files/run/t5273_1.check
new file mode 100644
index 0000000000..0cfbf08886
--- /dev/null
+++ b/test/files/run/t5273_1.check
@@ -0,0 +1 @@
+2
diff --git a/test/files/run/t5273_1.scala b/test/files/run/t5273_1.scala
new file mode 100644
index 0000000000..1175881c9f
--- /dev/null
+++ b/test/files/run/t5273_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{
+ List(1, 2, 3) match {
+ case foo :: bar :: _ => println(foo * bar)
+ case _ => println("this is getting out of hand!")
+ }
+ };
+
+ 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/t5273_2a.check b/test/files/run/t5273_2a.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/t5273_2a.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/t5273_2a.scala b/test/files/run/t5273_2a.scala
new file mode 100644
index 0000000000..12ddbb280a
--- /dev/null
+++ b/test/files/run/t5273_2a.scala
@@ -0,0 +1,15 @@
+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{
+ val foo :: bar :: _ = List(1, 2, 3)
+ println(foo * bar)
+ };
+
+ 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/t5273_2b.check b/test/files/run/t5273_2b.check
new file mode 100644
index 0000000000..c551774ca5
--- /dev/null
+++ b/test/files/run/t5273_2b.check
@@ -0,0 +1 @@
+name = American Dollar, shortname = USD, value = 2,8567
diff --git a/test/files/run/t5273_2b.scala b/test/files/run/t5273_2b.scala
new file mode 100644
index 0000000000..8b75084463
--- /dev/null
+++ b/test/files/run/t5273_2b.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{
+ val RegexParser = """(.*) \d+([A-Z]+) \| (.*) \|.*""".r
+ val RegexParser(name, shortname, value) = "American Dollar 1USD | 2,8567 | sometext"
+ println("name = %s, shortname = %s, value = %s".format(name, shortname, value))
+ };
+
+ 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/t5276_1a.check b/test/files/run/t5276_1a.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/t5276_1a.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/t5276_1a.scala b/test/files/run/t5276_1a.scala
new file mode 100644
index 0000000000..c8afbba19e
--- /dev/null
+++ b/test/files/run/t5276_1a.scala
@@ -0,0 +1,15 @@
+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{
+ lazy val x = 2
+ println(x)
+ };
+
+ 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/t5276_1b.check b/test/files/run/t5276_1b.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/t5276_1b.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/t5276_1b.scala b/test/files/run/t5276_1b.scala
new file mode 100644
index 0000000000..31582201fb
--- /dev/null
+++ b/test/files/run/t5276_1b.scala
@@ -0,0 +1,15 @@
+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{
+ implicit lazy val x = 2
+ implicitly[Int]
+ };
+
+ 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/t5276_2a.check b/test/files/run/t5276_2a.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/t5276_2a.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/t5276_2a.scala b/test/files/run/t5276_2a.scala
new file mode 100644
index 0000000000..179c14b739
--- /dev/null
+++ b/test/files/run/t5276_2a.scala
@@ -0,0 +1,18 @@
+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{
+ class C {
+ lazy val x = 2
+ }
+
+ println(new C().x)
+ };
+
+ 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/t5276_2b.check b/test/files/run/t5276_2b.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/t5276_2b.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/t5276_2b.scala b/test/files/run/t5276_2b.scala
new file mode 100644
index 0000000000..6fe2873fef
--- /dev/null
+++ b/test/files/run/t5276_2b.scala
@@ -0,0 +1,19 @@
+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{
+ class C {
+ implicit lazy val x = 2
+ def y = implicitly[Int]
+ }
+
+ println(new C().y)
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ toolbox.runExpr(ttree)
+}