diff options
author | Paul Phillips <paulp@improving.org> | 2012-03-09 16:28:48 -0500 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-03-09 18:51:48 -0500 |
commit | f1c39dd9816fd48663064307c39e2d9c8c936cd5 (patch) | |
tree | 68cec6bd3ab035fec3fa48da2fe664bbddcee8cb /test/files | |
parent | 42f90593538a16a285a9bb605da9fd9116e71a57 (diff) | |
download | scala-f1c39dd9816fd48663064307c39e2d9c8c936cd5.tar.gz scala-f1c39dd9816fd48663064307c39e2d9c8c936cd5.tar.bz2 scala-f1c39dd9816fd48663064307c39e2d9c8c936cd5.zip |
Add symbol to Manifests.
Phantom types were vanishing during the erasure which takes
place from manifest -> class object -> tpe.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/manifests.scala | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/test/files/run/manifests.scala b/test/files/run/manifests.scala index 1da06b8aee..6b6ea80b34 100644 --- a/test/files/run/manifests.scala +++ b/test/files/run/manifests.scala @@ -46,11 +46,20 @@ object Test def showsContravariance[T, U, CC[_]](implicit ev1: Manifest[T], ev2: Manifest[U], ev3: Manifest[CC[T]], ev4: Manifest[CC[U]]) = new VarianceTester[T, U, CC](CONTRA) showsExpectedVariance - def typeCompare[T, U](implicit ev1: Manifest[T], ev2: Manifest[U]) = (ev1 <:< ev2, ev2 <:< ev1) match { - case (true, true) => SAME - case (true, false) => SUB - case (false, true) => SUPER - case (false, false) => NONE + def typeCompare[T, U](implicit ev1: Manifest[T], ev2: Manifest[U]) = { + // checking types as well + if ((ev1 <:< ev2) != (ev1.tpe <:< ev2.tpe)) + println("Failed! " + ((ev1, ev2))) + + if ((ev2 <:< ev1) != (ev2.tpe <:< ev1.tpe)) + println("Failed! " + ((ev2, ev1))) + + (ev1 <:< ev2, ev2 <:< ev1) match { + case (true, true) => SAME + case (true, false) => SUB + case (false, true) => SUPER + case (false, false) => NONE + } } def assertAnyRef[T: Manifest] = List( |