diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-10-04 14:07:41 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-10-04 14:07:41 -0700 |
commit | d55f9c1bebf9431d2e7d57d79e47159d1d1f154c (patch) | |
tree | 3ca1f358702d5711d63a6f32a229db642459d5bc | |
parent | 3ffc62b49914c6bf466f0f5e10c8f34b2cff5899 (diff) | |
parent | 53e8009192a9473101bf20998dd6111bd0160d6f (diff) | |
download | scala-d55f9c1bebf9431d2e7d57d79e47159d1d1f154c.tar.gz scala-d55f9c1bebf9431d2e7d57d79e47159d1d1f154c.tar.bz2 scala-d55f9c1bebf9431d2e7d57d79e47159d1d1f154c.zip |
Merge pull request #1438 from paulp/raw-type-fidelity
Fix for gluttunous raw type creation.
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index e4a17f3f41..53893c2eda 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -732,17 +732,19 @@ abstract class ClassfileParser { } accept('>') assert(xs.length > 0, tp) - newExistentialType(existentials.toList, typeRef(pre, classSym, xs.toList)) - } else if (classSym.isMonomorphicType) { + logResult("new existential")(newExistentialType(existentials.toList, typeRef(pre, classSym, xs.toList))) + } + // isMonomorphicType is false if the info is incomplete, as it usually is here + // 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 - } else { + } + else { // raw type - existentially quantify all type parameters val eparams = typeParamsToExistentials(classSym, classSym.unsafeTypeParams) - val t = typeRef(pre, classSym, eparams.map(_.tpeHK)) - val res = newExistentialType(eparams, t) - if (settings.debug.value && settings.verbose.value) - println("raw type " + classSym + " -> " + res) - res + val t = typeRef(pre, classSym, eparams.map(_.tpeHK)) + logResult(s"raw type from $classSym")(newExistentialType(eparams, t)) } case tp => assert(sig.charAt(index) != '<', tp) |