summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-12 20:43:17 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-12 20:43:17 -0800
commited4ae1d35903736da215c568d530d9fa20b0d60a (patch)
tree0c3c4563380a51f0a70576bcc4c0c2969066ee30 /src
parentc0edf768912e07690cf904eabf1acb5b2eefbd5e (diff)
parentf62e280825422c1e64c2427bc5958869662701ca (diff)
downloadscala-ed4ae1d35903736da215c568d530d9fa20b0d60a.tar.gz
scala-ed4ae1d35903736da215c568d530d9fa20b0d60a.tar.bz2
scala-ed4ae1d35903736da215c568d530d9fa20b0d60a.zip
Merge pull request #3519 from adriaanm/rebase-3483
SI-8244 Fix raw type regression under separate compilation
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala7
-rw-r--r--src/reflect/scala/reflect/internal/Definitions.scala9
2 files changed, 11 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 664645e53e..2f9cc01c0b 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -665,8 +665,11 @@ abstract class ClassfileParser {
// so have to check unsafeTypeParams.isEmpty before worrying about raw type case below,
// or we'll create a boatload of needless existentials.
else if (classSym.isMonomorphicType || classSym.unsafeTypeParams.isEmpty) tp
- // raw type - existentially quantify all type parameters
- else debuglogResult(s"raw type from $classSym")(unsafeClassExistentialType(classSym))
+ else debuglogResult(s"raw type from $classSym"){
+ // raw type - existentially quantify all type parameters
+ val eparams = typeParamsToExistentials(classSym, classSym.unsafeTypeParams)
+ newExistentialType(eparams, typeRef(pre, classSym, eparams.map(_.tpeHK)))
+ }
case tp =>
assert(sig.charAt(index) != '<', s"sig=$sig, index=$index, tp=$tp")
tp
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala
index 78e639fdff..645d6aa4ff 100644
--- a/src/reflect/scala/reflect/internal/Definitions.scala
+++ b/src/reflect/scala/reflect/internal/Definitions.scala
@@ -898,12 +898,15 @@ trait Definitions extends api.StandardDefinitions {
*
* C[E1, ..., En] forSome { E1 >: LB1 <: UB1 ... en >: LBn <: UBn }.
*/
+ // TODO Review the way this is used. I see two potential problems:
+ // 1. `existentialAbstraction` here doesn't create fresh existential type symbols, it just
+ // uses the class type parameter symbols directly as the list of quantified symbols.
+ // See SI-8244 for the trouble that this can cause.
+ // Compare with callers of `typeParamsToExistentials` (used in Java raw type handling)
+ // 2. Why don't we require a prefix? Could its omission lead to wrong results in CheckabilityChecker?
def classExistentialType(clazz: Symbol): Type =
existentialAbstraction(clazz.typeParams, clazz.tpe_*)
- def unsafeClassExistentialType(clazz: Symbol): Type =
- existentialAbstraction(clazz.unsafeTypeParams, clazz.tpe_*)
-
// members of class scala.Any
// TODO these aren't final! They are now overriden in AnyRef/Object. Prior to the fix