Browse files

SI-6897, lubs and varargs star.

Don't allow lubs to calculate refinement types which contain
a varargs star outside of legal varargs star position.
  • Loading branch information...
1 parent ca98602 commit 340529410696da2e5110d49a5a8d19572bf272ba @paulp paulp committed Dec 31, 2012
Showing with 10 additions and 1 deletion.
  1. +4 −1 src/reflect/scala/reflect/internal/Types.scala
  2. +6 −0 test/files/pos/t6897.scala
View
5 src/reflect/scala/reflect/internal/Types.scala
@@ -6801,7 +6801,10 @@ trait Types extends api.Types { self: SymbolTable =>
else lubBase
}
}
- existentialAbstraction(tparams, lubType)
+ // dropRepeatedParamType is a localized fix for SI-6897. We should probably
+ // integrate that transformation at a lower level in master, but lubs are
+ // the likely and maybe only spot they escape, so fixing here for 2.10.1.
+ existentialAbstraction(tparams, dropRepeatedParamType(lubType))
}
if (printLubs) {
println(indent + "lub of " + ts + " at depth "+depth)//debug
View
6 test/files/pos/t6897.scala
@@ -0,0 +1,6 @@
+class A {
+ val html = (null: Any) match {
+ case 1 => <xml:group></xml:group>
+ case 2 => <p></p>
+ }
+}

0 comments on commit 3405294

Please sign in to comment.