diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-01-28 15:12:38 +0300 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-02-14 14:16:43 +0100 |
commit | df061de3fb2bc9a96d7bc77dc45c09f10fdb8531 (patch) | |
tree | 3dca5fbbbfd91ecb0e9b8ac1667bf8046b58b0e4 /test/files | |
parent | 202eb73b6cd6ebb3e20ff9f0a198c4ea83319851 (diff) | |
download | scala-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')
-rw-r--r-- | test/files/run/reflection-idtc.check | 6 | ||||
-rw-r--r-- | test/files/run/reflection-idtc.scala | 16 |
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 |