@@ -10,14 +10,18 @@ import annotation.tailrec
1010object Hashable {
1111
1212 /** A null terminated list of BindingTypes. We use `null` here for efficiency */
13- class Binders (val tp : BindingType , val next : Binders | Null )
13+ class SomeBinders (val tp : BindingType , val next : Binders )
14+
15+ type Binders = SomeBinders | Null
1416
1517 /** A null terminated list of pairs of BindingTypes. Used for isomorphism tests. */
16- class BinderPairs (tp1 : BindingType , tp2 : BindingType , next : BinderPairs | Null ) {
18+ class SomeBinderPairs (tp1 : BindingType , tp2 : BindingType , next : BinderPairs ) {
1719 @ tailrec final def matches (t1 : Type , t2 : Type ): Boolean =
1820 (t1 `eq` tp1) && (t2 `eq` tp2) || next != null && next.matches(t1, t2)
1921 }
2022
23+ type BinderPairs = SomeBinderPairs | Null
24+
2125 /** A hash value indicating that the underlying type is not
2226 * cached in uniques.
2327 */
@@ -45,24 +49,24 @@ trait Hashable {
4549 protected final def finishHash (hashCode : Int , arity : Int ): Int =
4650 avoidSpecialHashes(hashing.finalizeHash(hashCode, arity))
4751
48- final def typeHash (bs : Binders | Null , tp : Type ): Int =
52+ final def typeHash (bs : Binders , tp : Type ): Int =
4953 if (bs == null || tp.hashIsStable) tp.hash else tp.computeHash(bs)
5054
51- def identityHash (bs : Binders | Null ): Int = avoidSpecialHashes(System .identityHashCode(this ))
55+ def identityHash (bs : Binders ): Int = avoidSpecialHashes(System .identityHashCode(this ))
5256
53- protected def finishHash (bs : Binders | Null , seed : Int , arity : Int , tp : Type ): Int = {
57+ protected def finishHash (bs : Binders , seed : Int , arity : Int , tp : Type ): Int = {
5458 val elemHash = typeHash(bs, tp)
5559 if (elemHash == NotCached ) return NotCached
5660 finishHash(hashing.mix(seed, elemHash), arity + 1 )
5761 }
5862
59- protected def finishHash (bs : Binders | Null , seed : Int , arity : Int , tp1 : Type , tp2 : Type ): Int = {
63+ protected def finishHash (bs : Binders , seed : Int , arity : Int , tp1 : Type , tp2 : Type ): Int = {
6064 val elemHash = typeHash(bs, tp1)
6165 if (elemHash == NotCached ) return NotCached
6266 finishHash(bs, hashing.mix(seed, elemHash), arity + 1 , tp2)
6367 }
6468
65- protected def finishHash (bs : Binders | Null , seed : Int , arity : Int , tps : List [Type ]): Int = {
69+ protected def finishHash (bs : Binders , seed : Int , arity : Int , tps : List [Type ]): Int = {
6670 var h = seed
6771 var xs = tps
6872 var len = arity
@@ -76,7 +80,7 @@ trait Hashable {
7680 finishHash(h, len)
7781 }
7882
79- protected def finishHash (bs : Binders | Null , seed : Int , arity : Int , tp : Type , tps : List [Type ]): Int = {
83+ protected def finishHash (bs : Binders , seed : Int , arity : Int , tp : Type , tps : List [Type ]): Int = {
8084 val elemHash = typeHash(bs, tp)
8185 if (elemHash == NotCached ) return NotCached
8286 finishHash(bs, hashing.mix(seed, elemHash), arity + 1 , tps)
@@ -86,28 +90,28 @@ trait Hashable {
8690 protected final def doHash (x : Any ): Int =
8791 finishHash(hashing.mix(hashSeed, x.hashCode), 1 )
8892
89- protected final def doHash (bs : Binders | Null , tp : Type ): Int =
93+ protected final def doHash (bs : Binders , tp : Type ): Int =
9094 finishHash(bs, hashSeed, 0 , tp)
9195
92- protected final def doHash (bs : Binders | Null , x1 : Any , tp2 : Type ): Int =
96+ protected final def doHash (bs : Binders , x1 : Any , tp2 : Type ): Int =
9397 finishHash(bs, hashing.mix(hashSeed, x1.hashCode), 1 , tp2)
9498
95- protected final def doHash (bs : Binders | Null , x1 : Int , tp2 : Type ): Int =
99+ protected final def doHash (bs : Binders , x1 : Int , tp2 : Type ): Int =
96100 finishHash(bs, hashing.mix(hashSeed, x1), 1 , tp2)
97101
98- protected final def doHash (bs : Binders | Null , x1 : Int , tp2 : Type , tp3 : Type ): Int =
102+ protected final def doHash (bs : Binders , x1 : Int , tp2 : Type , tp3 : Type ): Int =
99103 finishHash(bs, hashing.mix(hashSeed, x1), 1 , tp2, tp3)
100104
101- protected final def doHash (bs : Binders | Null , tp1 : Type , tp2 : Type ): Int =
105+ protected final def doHash (bs : Binders , tp1 : Type , tp2 : Type ): Int =
102106 finishHash(bs, hashSeed, 0 , tp1, tp2)
103107
104- protected final def doHash (bs : Binders | Null , x1 : Any , tp2 : Type , tp3 : Type ): Int =
108+ protected final def doHash (bs : Binders , x1 : Any , tp2 : Type , tp3 : Type ): Int =
105109 finishHash(bs, hashing.mix(hashSeed, x1.hashCode), 1 , tp2, tp3)
106110
107- protected final def doHash (bs : Binders | Null , tp1 : Type , tps2 : List [Type ]): Int =
111+ protected final def doHash (bs : Binders , tp1 : Type , tps2 : List [Type ]): Int =
108112 finishHash(bs, hashSeed, 0 , tp1, tps2)
109113
110- protected final def doHash (bs : Binders | Null , x1 : Any , tp2 : Type , tps3 : List [Type ]): Int =
114+ protected final def doHash (bs : Binders , x1 : Any , tp2 : Type , tps3 : List [Type ]): Int =
111115 finishHash(bs, hashing.mix(hashSeed, x1.hashCode), 1 , tp2, tps3)
112116
113117 protected final def doHash (x1 : Int , x2 : Int ): Int =
0 commit comments