summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-05-27 14:29:51 +1000
committerAdriaan Moors <adriaan@lightbend.com>2017-01-09 16:06:49 -0800
commit8138e24bbdccacdfee9873c5a0e21afaf78c6369 (patch)
tree8476efc36b2535e7332e74d2fb85dcf03c87724c /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
parent4f5c30e10a16697edbe7bb6b4719ff09f5c3900b (diff)
downloadscala-8138e24bbdccacdfee9873c5a0e21afaf78c6369.tar.gz
scala-8138e24bbdccacdfee9873c5a0e21afaf78c6369.tar.bz2
scala-8138e24bbdccacdfee9873c5a0e21afaf78c6369.zip
SI-9331 Fix canEqual for case classes with HK type params
Time for the courage of our convictions: follow the advice of my TODO comment from SI-8244 / f62e280825 and fix `classExistentialType` once and for all. This is the change in the generated `canEquals` method in the test case; we no longer get a kind conformance error. ``` --- sandbox/old.log 2015-05-27 14:31:27.000000000 +1000 +++ sandbox/new.log 2015-05-27 14:31:29.000000000 +1000 @@ -15,7 +15,7 @@ case _ => throw new IndexOutOfBoundsException(x$1.toString()) }; override <synthetic> def productIterator: Iterator[Any] = runtime.this.ScalaRunTime.typedProductIterator[Any](Stuff.this); - <synthetic> def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[Stuff[Proxy[PP]]](); + <synthetic> def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[Stuff[_ <: [PP]Proxy[PP]]](); override <synthetic> def hashCode(): Int = ScalaRunTime.this._hashCode(Stuff.this); override <synthetic> def toString(): String = ScalaRunTime.this._toString(Stuff.this); override <synthetic> def equals(x$1: Any): Boolean = x$1 match { @@ -38,9 +38,3 @@ } } ``` I also heeded my own advice to pass in a prefix to this method.
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index 99e61d2482..9b73f203e0 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -676,10 +676,9 @@ 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
- else debuglogResult(s"raw type from $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)))
+ classExistentialType(pre, classSym)
}
case tp =>
assert(sig.charAt(index) != '<', s"sig=$sig, index=$index, tp=$tp")