summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-04-13 17:32:38 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-04-14 11:50:28 +0200
commite1c8e2da26831c9a2d123bed5cb0f53230a3f939 (patch)
treead18a58319e60eefbe43511f9db0a404492fbf0e /test
parent3515ac4449c72992be411e1e0579d76189dc7bf1 (diff)
downloadscala-e1c8e2da26831c9a2d123bed5cb0f53230a3f939.tar.gz
scala-e1c8e2da26831c9a2d123bed5cb0f53230a3f939.tar.bz2
scala-e1c8e2da26831c9a2d123bed5cb0f53230a3f939.zip
wip: put skeleton for typetag-based typetests in place
Diffstat (limited to 'test')
-rw-r--r--test/files/run/patmat_unapp_abstype.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/run/patmat_unapp_abstype.scala b/test/files/run/patmat_unapp_abstype.scala
index fb0b491d39..45496f08a2 100644
--- a/test/files/run/patmat_unapp_abstype.scala
+++ b/test/files/run/patmat_unapp_abstype.scala
@@ -19,6 +19,11 @@ trait TypesUser extends TypesAPI {
def shouldNotCrash(tp: Type): Unit = {
tp match {
case TypeRef(x) => println("TypeRef")
+ // the above checks tp.isInstanceOf[TypeRef], which is erased to tp.isInstanceOf[Type]
+ // before calling TypeRef.unapply(tp), which will then crash unless tp.isInstanceOf[TypesImpl#TypeRef] (which is not implied by tp.isInstanceOf[Type])
+ // tp.isInstanceOf[TypesImpl#TypeRef] is equivalent to classOf[TypesImpl#TypeRef].isAssignableFrom(tp.getClass)
+ // this is equivalent to manifest
+ // it is NOT equivalent to manifest[Type] <:< typeRefMani
case MethodType(x) => println("MethodType")
case _ => println("none of the above")
}