From 340529410696da2e5110d49a5a8d19572bf272ba Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 31 Dec 2012 01:49:32 -0800 Subject: 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. --- src/reflect/scala/reflect/internal/Types.scala | 5 ++++- test/files/pos/t6897.scala | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/files/pos/t6897.scala diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 119a57d268..bfd18f6a43 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/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 diff --git a/test/files/pos/t6897.scala b/test/files/pos/t6897.scala new file mode 100644 index 0000000000..a7a03a1d3a --- /dev/null +++ b/test/files/pos/t6897.scala @@ -0,0 +1,6 @@ +class A { + val html = (null: Any) match { + case 1 => + case 2 =>

+ } +} -- cgit v1.2.3