diff options
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/Hashable.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Hashable.scala b/src/dotty/tools/dotc/core/Hashable.scala index 9d3356887..6a64f8655 100644 --- a/src/dotty/tools/dotc/core/Hashable.scala +++ b/src/dotty/tools/dotc/core/Hashable.scala @@ -88,6 +88,10 @@ trait Hashable { protected final def doHash(x1: Any, tp2: Type, tps3: List[Type]): Int = finishHash(hashing.mix(hashSeed, x1.hashCode), 1, tp2, tps3) + + protected final def doHash(x1: Int, x2: Int): Int = + finishHash(hashing.mix(hashing.mix(hashSeed, x1), x2), 1) + protected final def addDelta(hc: Int, delta: Int) = avoidNotCached(hc + delta) private def avoidNotCached(h: Int) = if (h == NotCached) NotCachedAlt else h diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 3b9bcd56d..5f72497fc 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2374,7 +2374,8 @@ object Types { // no customized hashCode/equals needed because cycle is broken in PolyType override def toString = s"PolyParam(${binder.paramNames(paramNum)})" - override def computeHash = finishHash(hashing.mix(hashing.mix(hashSeed, paramNum), binder.identityHash), 1) + override def computeHash = doHash(paramNum, binder.identityHash) + override def equals(that: Any) = that match { case that: PolyParam => (this.binder eq that.binder) && this.paramNum == that.paramNum |