summaryrefslogtreecommitdiff
path: root/test/files/run/constant-type.scala
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-09-27 13:18:45 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-09-27 13:18:45 -0400
commit6d39c9529d1018801a4fda95466bf8720416abad (patch)
tree6880f41a6368a6e130ee7ab428ae87698ce4930e /test/files/run/constant-type.scala
parent6ec0fe522256e48f8ccc0204d7c4ed63a34d9ede (diff)
parent709bb01175c512d124da9874dcaea50022374715 (diff)
downloadscala-6d39c9529d1018801a4fda95466bf8720416abad.tar.gz
scala-6d39c9529d1018801a4fda95466bf8720416abad.tar.bz2
scala-6d39c9529d1018801a4fda95466bf8720416abad.zip
Merge 2.10.x into master to fix breaking tests and keep things up-to-date.
Diffstat (limited to 'test/files/run/constant-type.scala')
-rw-r--r--test/files/run/constant-type.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/constant-type.scala b/test/files/run/constant-type.scala
new file mode 100644
index 0000000000..373746af4a
--- /dev/null
+++ b/test/files/run/constant-type.scala
@@ -0,0 +1,17 @@
+import scala.tools.partest.ReplTest
+
+// see the commit message to understand what this stuff is about
+// just a quick note:
+// transformedType returns an erased version of the type
+// as explained in the commit message, Type.erasure won't do for this test
+// because it does some postprocessing to the result of transformedType
+object Test extends ReplTest {
+ def code = """
+:power
+val s = transformedType(StringClass.toType).asInstanceOf[Type]
+{ println(exitingPhase(currentRun.erasurePhase)(ConstantType(Constant(s)))) }
+{ exitingPhase(currentRun.erasurePhase)(println(ConstantType(Constant(s)))) }
+{ ConstantType(Constant(s)); println(exitingPhase(currentRun.erasurePhase)(ConstantType(Constant(s)))); }
+{ ConstantType(Constant(s)); exitingPhase(currentRun.erasurePhase)(println(ConstantType(Constant(s)))); }
+ """
+}