diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-04-13 17:32:38 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-04-14 11:50:28 +0200 |
commit | e1c8e2da26831c9a2d123bed5cb0f53230a3f939 (patch) | |
tree | ad18a58319e60eefbe43511f9db0a404492fbf0e /test/files | |
parent | 3515ac4449c72992be411e1e0579d76189dc7bf1 (diff) | |
download | scala-e1c8e2da26831c9a2d123bed5cb0f53230a3f939.tar.gz scala-e1c8e2da26831c9a2d123bed5cb0f53230a3f939.tar.bz2 scala-e1c8e2da26831c9a2d123bed5cb0f53230a3f939.zip |
wip: put skeleton for typetag-based typetests in place
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/patmat_unapp_abstype.scala | 5 |
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") } |