summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-02-13 22:04:54 +0100
committerEugene Burmako <xeno.by@gmail.com>2012-02-14 00:40:51 +0100
commitadb218d8d230b4713942f5b220d8cd0602995aae (patch)
treeed6db1c13ca3a36098ca54f9a5c46e2e82f0e59f /test/files
parent6548dcf12d83e327df2f90048140fb95346b7e95 (diff)
downloadscala-adb218d8d230b4713942f5b220d8cd0602995aae.tar.gz
scala-adb218d8d230b4713942f5b220d8cd0602995aae.tar.bz2
scala-adb218d8d230b4713942f5b220d8cd0602995aae.zip
Fixes https://issues.scala-lang.org/browse/SI-5229
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/reify_inner1.check1
-rw-r--r--test/files/run/reify_inner1.scala22
-rw-r--r--test/files/run/reify_inner2.check1
-rw-r--r--test/files/run/reify_inner2.scala22
-rw-r--r--test/files/run/reify_inner3.check1
-rw-r--r--test/files/run/reify_inner3.scala22
-rw-r--r--test/files/run/reify_inner4.check1
-rw-r--r--test/files/run/reify_inner4.scala22
-rw-r--r--test/files/run/t5229_1.check0
-rw-r--r--test/files/run/t5229_1.scala14
-rw-r--r--test/files/run/t5229_2.check2
-rw-r--r--test/files/run/t5229_2.scala19
-rw-r--r--test/files/run/t5270.check1
-rw-r--r--test/files/run/t5270.scala26
14 files changed, 154 insertions, 0 deletions
diff --git a/test/files/run/reify_inner1.check b/test/files/run/reify_inner1.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_inner1.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_inner1.scala b/test/files/run/reify_inner1.scala
new file mode 100644
index 0000000000..69931198e0
--- /dev/null
+++ b/test/files/run/reify_inner1.scala
@@ -0,0 +1,22 @@
+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 {
+ class D {
+ val x = 2
+ }
+ }
+
+ val outer = new C()
+ val inner = new outer.D()
+ println(inner.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/reify_inner2.check b/test/files/run/reify_inner2.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_inner2.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_inner2.scala b/test/files/run/reify_inner2.scala
new file mode 100644
index 0000000000..0f12fd472a
--- /dev/null
+++ b/test/files/run/reify_inner2.scala
@@ -0,0 +1,22 @@
+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 {
+ object D {
+ val x = 2
+ }
+ }
+
+ val outer = new C()
+ val inner = outer.D
+ println(inner.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/reify_inner3.check b/test/files/run/reify_inner3.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_inner3.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_inner3.scala b/test/files/run/reify_inner3.scala
new file mode 100644
index 0000000000..6b97b42b34
--- /dev/null
+++ b/test/files/run/reify_inner3.scala
@@ -0,0 +1,22 @@
+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 {
+ class D {
+ val x = 2
+ }
+ }
+
+ val outer = C
+ val inner = new outer.D
+ println(inner.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/reify_inner4.check b/test/files/run/reify_inner4.check
new file mode 100644
index 0000000000..d8263ee986
--- /dev/null
+++ b/test/files/run/reify_inner4.check
@@ -0,0 +1 @@
+2 \ No newline at end of file
diff --git a/test/files/run/reify_inner4.scala b/test/files/run/reify_inner4.scala
new file mode 100644
index 0000000000..de8c973b09
--- /dev/null
+++ b/test/files/run/reify_inner4.scala
@@ -0,0 +1,22 @@
+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 {
+ object D {
+ val x = 2
+ }
+ }
+
+ val outer = C
+ val inner = outer.D
+ println(inner.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/t5229_1.check b/test/files/run/t5229_1.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/t5229_1.check
diff --git a/test/files/run/t5229_1.scala b/test/files/run/t5229_1.scala
new file mode 100644
index 0000000000..1d7bf0590b
--- /dev/null
+++ b/test/files/run/t5229_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{
+ 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/t5229_2.check b/test/files/run/t5229_2.check
new file mode 100644
index 0000000000..5db6ec9b38
--- /dev/null
+++ b/test/files/run/t5229_2.check
@@ -0,0 +1,2 @@
+2
+evaluated = null
diff --git a/test/files/run/t5229_2.scala b/test/files/run/t5229_2.scala
new file mode 100644
index 0000000000..67be7328a6
--- /dev/null
+++ b/test/files/run/t5229_2.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{
+ object C {
+ val x = 2
+ }
+
+ println(C.x)
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ val evaluated = toolbox.runExpr(ttree)
+ println("evaluated = " + evaluated)
+}
diff --git a/test/files/run/t5270.check b/test/files/run/t5270.check
new file mode 100644
index 0000000000..08839f6bb2
--- /dev/null
+++ b/test/files/run/t5270.check
@@ -0,0 +1 @@
+200
diff --git a/test/files/run/t5270.scala b/test/files/run/t5270.scala
new file mode 100644
index 0000000000..10f79790b0
--- /dev/null
+++ b/test/files/run/t5270.scala
@@ -0,0 +1,26 @@
+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 Y {
+ def y = 100
+ }
+
+ trait Z { this: Y =>
+ val z = 2 * y
+ }
+
+ class X extends Y with Z {
+ def println() = Predef.println(z)
+ }
+
+ new X().println()
+ };
+
+ val reporter = new ConsoleReporter(new Settings)
+ val toolbox = new ToolBox(reporter)
+ val ttree = toolbox.typeCheck(code.tree)
+ toolbox.runExpr(ttree)
+}