Skip to content

Commit 4e86a9d

Browse files
committed
Hashable: make finishHash protected.
Is in sync with hashSeed being protected.
1 parent b1cb0af commit 4e86a9d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ trait Hashable {
3030

3131
protected def hashSeed: Int = getClass.hashCode
3232

33-
private def finishHash(hashCode: Int, arity: Int): Int =
33+
protected final def finishHash(hashCode: Int, arity: Int): Int =
3434
avoidNotCached(hashing.finalizeHash(hashCode, arity))
3535

3636
final def identityHash = avoidNotCached(System.identityHashCode(this))
3737

38-
private def finishHash(seed: Int, arity: Int, tp: Type): Int = {
38+
protected def finishHash(seed: Int, arity: Int, tp: Type): Int = {
3939
val elemHash = tp.hash
4040
if (elemHash == NotCached) return NotCached
4141
finishHash(hashing.mix(seed, elemHash), arity + 1)
4242
}
4343

44-
private def finishHash(seed: Int, arity: Int, tp1: Type, tp2: Type): Int = {
44+
protected def finishHash(seed: Int, arity: Int, tp1: Type, tp2: Type): Int = {
4545
val elemHash = tp1.hash
4646
if (elemHash == NotCached) return NotCached
4747
finishHash(hashing.mix(seed, elemHash), arity + 1, tp2)
4848
}
4949

50-
private def finishHash(seed: Int, arity: Int, tps: List[Type]): Int = {
50+
protected def finishHash(seed: Int, arity: Int, tps: List[Type]): Int = {
5151
var h = seed
5252
var xs = tps
5353
var len = arity
@@ -61,7 +61,7 @@ trait Hashable {
6161
finishHash(h, len)
6262
}
6363

64-
private def finishHash(seed: Int, arity: Int, tp: Type, tps: List[Type]): Int = {
64+
protected def finishHash(seed: Int, arity: Int, tp: Type, tps: List[Type]): Int = {
6565
val elemHash = tp.hash
6666
if (elemHash == NotCached) return NotCached
6767
finishHash(hashing.mix(seed, elemHash), arity + 1, tps)

0 commit comments

Comments
 (0)