We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dab5e51 commit e90d759Copy full SHA for e90d759
compiler/src/dotty/tools/dotc/core/Types.scala
@@ -1528,8 +1528,15 @@ object Types {
1528
*/
1529
trait BindingType extends Type {
1530
1531
- override def identityHash(bs: Binders) =
1532
- if (bs == null) super.identityHash(bs) else bs.hash
+ override def identityHash(bs: Binders) = {
+ def recur(n: Int, tp: BindingType, rest: Binders): Int =
1533
+ if (this `eq` tp) finishHash(hashing.mix(hashSeed, n), 1)
1534
+ else if (rest == null) System.identityHashCode(this)
1535
+ else recur(n + 1, rest.tp, rest.next)
1536
+ avoidSpecialHashes(
1537
+ if (bs == null) System.identityHashCode(this)
1538
+ else recur(1, bs.tp, bs.next))
1539
+ }
1540
1541
def equalBinder(that: BindingType, bs: BinderPairs): Boolean =
1542
(this `eq` that) || bs != null && bs.matches(this, that)
0 commit comments