summaryrefslogtreecommitdiff
path: root/test/files/run/reflection-idtc.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-28 15:12:38 +0300
committerEugene Burmako <xeno.by@gmail.com>2014-02-14 14:16:43 +0100
commitdf061de3fb2bc9a96d7bc77dc45c09f10fdb8531 (patch)
tree3dca5fbbbfd91ecb0e9b8ac1667bf8046b58b0e4 /test/files/run/reflection-idtc.scala
parent202eb73b6cd6ebb3e20ff9f0a198c4ea83319851 (diff)
downloadscala-df061de3fb2bc9a96d7bc77dc45c09f10fdb8531.tar.gz
scala-df061de3fb2bc9a96d7bc77dc45c09f10fdb8531.tar.bz2
scala-df061de3fb2bc9a96d7bc77dc45c09f10fdb8531.zip
splits Type.normalize into dealias and etaExpand
normalize is a highly overloaded name and it also conflates two distinct operators, so how about we give our users self-explaning atomic tools instead.
Diffstat (limited to 'test/files/run/reflection-idtc.scala')
-rw-r--r--test/files/run/reflection-idtc.scala16
1 files changed, 16 insertions, 0 deletions
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