From f62e280825422c1e64c2427bc5958869662701ca Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 7 Feb 2014 11:52:55 +0100 Subject: SI-8244 Fix raw type regression under separate compilation In #1901, handling of raw types encountered in signatures during class file parsing was changed to work in the same manner as `classExistentialType`, by using `existentialAbstraction(cls.tparms, cls.tpe_*)` But this never creates fresh existential symbols, and just sticks the class type parameters it `quantified`: scala> trait T[A <: String] defined trait T scala> val cls = typeOf[T[_]].typeSymbol cls = trait T#101864 scala> cls.typeParams res0 = List(type A#101865) scala> cls.tpe_* res1 = T#101864[A#101865] scala> classExistentialType(cls) res3 = T#101864[_ <: String#7209] scala> val ExistentialType(quantified, result) = res3 List(type A#101865) In the enclosed test case, this class type parameter was substituted during `typeOf[X] memberType sym`, which led us unsoundly thinking that `Raw[_]` was `Raw[X]`. I've added a TODO comment to review the other usages of `classExistentialType`. Test variations include joint and separate compilation, and the corresponding Scala-only code. All fail with type errors now, as we expect. I've also added a distillation of a bootstrap error that failed when I forgot to wrap the `existentialType`. --- test/files/pos/t8244d/InodeBase_1.java | 6 ++++++ test/files/pos/t8244d/Test_2.scala | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 test/files/pos/t8244d/InodeBase_1.java create mode 100644 test/files/pos/t8244d/Test_2.scala (limited to 'test/files/pos/t8244d') diff --git a/test/files/pos/t8244d/InodeBase_1.java b/test/files/pos/t8244d/InodeBase_1.java new file mode 100644 index 0000000000..36c2123418 --- /dev/null +++ b/test/files/pos/t8244d/InodeBase_1.java @@ -0,0 +1,6 @@ +import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; + +abstract class INodeBase_1 { + @SuppressWarnings("rawtypes") + public static final AtomicReferenceFieldUpdater updater = null; +} diff --git a/test/files/pos/t8244d/Test_2.scala b/test/files/pos/t8244d/Test_2.scala new file mode 100644 index 0000000000..cb39c9692c --- /dev/null +++ b/test/files/pos/t8244d/Test_2.scala @@ -0,0 +1,3 @@ +class INodeX[K, V] extends INodeBase_1[K, V] { + INodeBase_1.updater.set(this, null) +} -- cgit v1.2.3