From df061de3fb2bc9a96d7bc77dc45c09f10fdb8531 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 28 Jan 2014 15:12:38 +0300 Subject: 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. --- test/files/run/reflection-idtc.check | 6 ++++++ test/files/run/reflection-idtc.scala | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/files/run/reflection-idtc.check create mode 100644 test/files/run/reflection-idtc.scala (limited to 'test') 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 -- cgit v1.2.3