summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t5256a.check2
-rw-r--r--test/files/run/t5256a.scala9
-rw-r--r--test/files/run/t5256b.check2
-rw-r--r--test/files/run/t5256b.scala8
-rw-r--r--test/files/run/t5256d.check20
-rw-r--r--test/files/run/t5256d.scala10
-rw-r--r--test/files/run/t5256e.check2
-rw-r--r--test/files/run/t5256e.scala9
-rw-r--r--test/files/run/t5256f.check4
-rw-r--r--test/files/run/t5256f.scala19
-rw-r--r--test/files/run/t5258a.check1
-rw-r--r--test/files/run/t5258a.scala14
-rw-r--r--test/pending/run/t5256c.check0
-rw-r--r--test/pending/run/t5256c.scala10
-rw-r--r--test/pending/run/t5256g.check0
-rw-r--r--test/pending/run/t5256g.scala11
-rw-r--r--test/pending/run/t5256h.check8
-rw-r--r--test/pending/run/t5256h.scala8
-rw-r--r--test/pending/run/t5258b.check1
-rw-r--r--test/pending/run/t5258b.scala15
-rw-r--r--test/pending/run/t5258c.check1
-rw-r--r--test/pending/run/t5258c.scala15
22 files changed, 169 insertions, 0 deletions
diff --git a/test/files/run/t5256a.check b/test/files/run/t5256a.check
new file mode 100644
index 0000000000..304f4ddd79
--- /dev/null
+++ b/test/files/run/t5256a.check
@@ -0,0 +1,2 @@
+A
+true
diff --git a/test/files/run/t5256a.scala b/test/files/run/t5256a.scala
new file mode 100644
index 0000000000..05a935c770
--- /dev/null
+++ b/test/files/run/t5256a.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+class A
+
+object Test extends App {
+ val c = classToType(classOf[A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[A]))
+}
diff --git a/test/files/run/t5256b.check b/test/files/run/t5256b.check
new file mode 100644
index 0000000000..64f4c01166
--- /dev/null
+++ b/test/files/run/t5256b.check
@@ -0,0 +1,2 @@
+Test.A
+true \ No newline at end of file
diff --git a/test/files/run/t5256b.scala b/test/files/run/t5256b.scala
new file mode 100644
index 0000000000..5575211641
--- /dev/null
+++ b/test/files/run/t5256b.scala
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class A
+ val c = classToType(classOf[A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[A]))
+}
diff --git a/test/files/run/t5256d.check b/test/files/run/t5256d.check
new file mode 100644
index 0000000000..7924c15c5c
--- /dev/null
+++ b/test/files/run/t5256d.check
@@ -0,0 +1,20 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.reflect.mirror._
+import scala.reflect.mirror._
+
+scala> class A
+defined class A
+
+scala> val c = classToType(classOf[A])
+c: reflect.mirror.Type = A
+
+scala> println(c.typeSymbol == classToSymbol(classOf[A]))
+true
+
+scala>
+
+scala>
diff --git a/test/files/run/t5256d.scala b/test/files/run/t5256d.scala
new file mode 100644
index 0000000000..86404a9b63
--- /dev/null
+++ b/test/files/run/t5256d.scala
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+import scala.reflect.mirror._
+class A
+val c = classToType(classOf[A])
+println(c.typeSymbol == classToSymbol(classOf[A]))
+ """
+}
diff --git a/test/files/run/t5256e.check b/test/files/run/t5256e.check
new file mode 100644
index 0000000000..e50f917e14
--- /dev/null
+++ b/test/files/run/t5256e.check
@@ -0,0 +1,2 @@
+C.this.A
+true \ No newline at end of file
diff --git a/test/files/run/t5256e.scala b/test/files/run/t5256e.scala
new file mode 100644
index 0000000000..9ed422ca44
--- /dev/null
+++ b/test/files/run/t5256e.scala
@@ -0,0 +1,9 @@
+import scala.reflect.mirror._
+
+class C { class A }
+
+object Test extends App {
+ val c = classToType(classOf[C#A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[C#A]))
+}
diff --git a/test/files/run/t5256f.check b/test/files/run/t5256f.check
new file mode 100644
index 0000000000..ad2f375d9a
--- /dev/null
+++ b/test/files/run/t5256f.check
@@ -0,0 +1,4 @@
+Test.A1
+true
+Test.this.A2
+true
diff --git a/test/files/run/t5256f.scala b/test/files/run/t5256f.scala
new file mode 100644
index 0000000000..45c80cbd63
--- /dev/null
+++ b/test/files/run/t5256f.scala
@@ -0,0 +1,19 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ class A1
+
+ val c1 = classToType(classOf[A1])
+ println(c1)
+ println(c1.typeSymbol == classToSymbol(classOf[A1]))
+
+ new Test
+}
+
+class Test {
+ class A2
+
+ val c2 = classToType(classOf[A2])
+ println(c2)
+ println(c2.typeSymbol == classToSymbol(classOf[A2]))
+}
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
diff --git a/test/pending/run/t5256c.check b/test/pending/run/t5256c.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/pending/run/t5256c.check
diff --git a/test/pending/run/t5256c.scala b/test/pending/run/t5256c.scala
new file mode 100644
index 0000000000..8ebb51a009
--- /dev/null
+++ b/test/pending/run/t5256c.scala
@@ -0,0 +1,10 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ {
+ class A
+ val c = classToType(classOf[A])
+ println(c)
+ println(c.typeSymbol == classToSymbol(classOf[A]))
+ }
+}
diff --git a/test/pending/run/t5256g.check b/test/pending/run/t5256g.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/pending/run/t5256g.check
diff --git a/test/pending/run/t5256g.scala b/test/pending/run/t5256g.scala
new file mode 100644
index 0000000000..6158a9281d
--- /dev/null
+++ b/test/pending/run/t5256g.scala
@@ -0,0 +1,11 @@
+import scala.reflect.mirror._
+
+class A
+trait B
+
+object Test extends App {
+ val mutant = new A with B
+ val c = classToType(mutant.getClass)
+ println(c)
+ println(c.typeSymbol == classToSymbol(mutant.getClass))
+}
diff --git a/test/pending/run/t5256h.check b/test/pending/run/t5256h.check
new file mode 100644
index 0000000000..4f9b8faf71
--- /dev/null
+++ b/test/pending/run/t5256h.check
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val mutant = new { val x = 2 }
+ val c = classToType(mutant.getClass)
+ println(c)
+ println(c.typeSymbol == classToSymbol(mutant.getClass))
+}
diff --git a/test/pending/run/t5256h.scala b/test/pending/run/t5256h.scala
new file mode 100644
index 0000000000..4f9b8faf71
--- /dev/null
+++ b/test/pending/run/t5256h.scala
@@ -0,0 +1,8 @@
+import scala.reflect.mirror._
+
+object Test extends App {
+ val mutant = new { val x = 2 }
+ val c = classToType(mutant.getClass)
+ println(c)
+ println(c.typeSymbol == classToSymbol(mutant.getClass))
+}
diff --git a/test/pending/run/t5258b.check b/test/pending/run/t5258b.check
new file mode 100644
index 0000000000..283b4225fb
--- /dev/null
+++ b/test/pending/run/t5258b.check
@@ -0,0 +1 @@
+TBI \ No newline at end of file
diff --git a/test/pending/run/t5258b.scala b/test/pending/run/t5258b.scala
new file mode 100644
index 0000000000..70cb4a7f4e
--- /dev/null
+++ b/test/pending/run/t5258b.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{
+ class C
+ println(classOf[C])
+ };
+
+ 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
diff --git a/test/pending/run/t5258c.check b/test/pending/run/t5258c.check
new file mode 100644
index 0000000000..283b4225fb
--- /dev/null
+++ b/test/pending/run/t5258c.check
@@ -0,0 +1 @@
+TBI \ No newline at end of file
diff --git a/test/pending/run/t5258c.scala b/test/pending/run/t5258c.scala
new file mode 100644
index 0000000000..a93170d0d6
--- /dev/null
+++ b/test/pending/run/t5258c.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{
+ object E extends Enumeration { val foo, bar = Value }
+ println(E.foo)
+ };
+
+ 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