summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-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
12 files changed, 100 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