Skip to content

Commit fc5e2cf

Browse files
committed
Address review comments.
1 parent 0f5c1fd commit fc5e2cf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/dotty/tools/dotc/core/Hashable.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ trait Hashable {
8888
protected final def doHash(x1: Any, tp2: Type, tps3: List[Type]): Int =
8989
finishHash(hashing.mix(hashSeed, x1.hashCode), 1, tp2, tps3)
9090

91+
92+
protected final def doHash(x1: Int, x2: Int): Int =
93+
finishHash(hashing.mix(hashing.mix(hashSeed, x1), x2), 1)
94+
9195
protected final def addDelta(hc: Int, delta: Int) = avoidNotCached(hc + delta)
9296

9397
private def avoidNotCached(h: Int) = if (h == NotCached) NotCachedAlt else h

src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2374,7 +2374,8 @@ object Types {
23742374
// no customized hashCode/equals needed because cycle is broken in PolyType
23752375
override def toString = s"PolyParam(${binder.paramNames(paramNum)})"
23762376

2377-
override def computeHash = finishHash(hashing.mix(hashing.mix(hashSeed, paramNum), binder.identityHash), 1)
2377+
override def computeHash = doHash(paramNum, binder.identityHash)
2378+
23782379
override def equals(that: Any) = that match {
23792380
case that: PolyParam =>
23802381
(this.binder eq that.binder) && this.paramNum == that.paramNum

0 commit comments

Comments
 (0)