summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/reflection-idtc.check6
-rw-r--r--test/files/run/reflection-idtc.scala16
2 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/reflection-idtc.check b/test/files/run/reflection-idtc.check
new file mode 100644
index 0000000000..9cdeb02f8c
--- /dev/null
+++ b/test/files/run/reflection-idtc.check
@@ -0,0 +1,6 @@
+[X]X
+Int
+===
+[X]Id[X]
+Id[Int]
+Int
diff --git a/test/files/run/reflection-idtc.scala b/test/files/run/reflection-idtc.scala
new file mode 100644
index 0000000000..bbe90f6826
--- /dev/null
+++ b/test/files/run/reflection-idtc.scala
@@ -0,0 +1,16 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.ToolBox
+
+object Test extends App {
+ val tb = cm.mkToolBox()
+ val idsym = tb.typecheck(q"type Id[X] = X").symbol.asType
+ val idTC1 = idsym.typeSignature
+ println(idTC1)
+ println(appliedType(idTC1, List(typeOf[Int])))
+ println("===")
+ val idTC2 = idsym.toType.etaExpand
+ println(idTC2)
+ println(appliedType(idTC2, List(typeOf[Int])))
+ println(appliedType(idTC2, List(typeOf[Int])).dealias)
+} \ No newline at end of file