summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-28 19:43:31 +0000
committerPaul Phillips <paulp@improving.org>2011-01-28 19:43:31 +0000
commitb06bfabfa42cc089521e551acb9876a564ec027f (patch)
tree7c267eb160172e0c85d7594650a3927dc14d5237
parent0967826371df4675053b94a2857a6d78dd9028ea (diff)
downloadscala-b06bfabfa42cc089521e551acb9876a564ec027f.tar.gz
scala-b06bfabfa42cc089521e551acb9876a564ec027f.tar.bz2
scala-b06bfabfa42cc089521e551acb9876a564ec027f.zip
Fixed some generic signature bugs I found thank...
Fixed some generic signature bugs I found thanks to the compiler telling me it was buggy. Thanks compiler. No review.
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala6
-rw-r--r--test/files/pos/generic-sigs.flags1
-rw-r--r--test/files/pos/generic-sigs.scala7
3 files changed, 11 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index f89e005858..ccebcb62ea 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -250,9 +250,9 @@ abstract class Erasure extends AddInterfaces
val bounds = tp.typeSymbol.info.bounds
if (AnyRefClass.tpe <:< bounds.hi) {
if (bounds.lo <:< NullClass.tpe) "*"
- else "-" + jsig(bounds.lo)
+ else "-" + boxedSig(bounds.lo)
}
- else "+" + jsig(bounds.hi)
+ else "+" + boxedSig(bounds.hi)
}
else if (tp.typeSymbol == UnitClass) {
jsig(ObjectClass.tpe)
@@ -319,7 +319,7 @@ abstract class Erasure extends AddInterfaces
"("+(params map (_.tpe) map jsig).mkString+")"+
(if (restpe.typeSymbol == UnitClass || sym0.isConstructor) VOID_TAG.toString else jsig(restpe))
case RefinedType(parents, decls) if (!parents.isEmpty) =>
- jsig(parents.head)
+ boxedSig(parents.head)
case ClassInfoType(parents, _, _) =>
(parents map jsig).mkString
case AnnotatedType(_, atp, _) =>
diff --git a/test/files/pos/generic-sigs.flags b/test/files/pos/generic-sigs.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/generic-sigs.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/generic-sigs.scala b/test/files/pos/generic-sigs.scala
new file mode 100644
index 0000000000..4822cfcfb0
--- /dev/null
+++ b/test/files/pos/generic-sigs.scala
@@ -0,0 +1,7 @@
+object A {
+ def f1 = List(classOf[Int], classOf[String])
+ def f2 = List(classOf[String], classOf[Int])
+ def f3(x: Class[_ <: Int]) = x
+ def f4(x: Class[_ <: String with Int]) = x
+ def f5(x: Class[_ <: Int with String]) = x
+} \ No newline at end of file