Skip to content

Commit 4876e3b

Browse files
committed
Revert: Make hash codes on type more predictable.
getSimpleName crashes on some module names created by scalac. May help finding the partest issue. (reverted from commit c11646c)
1 parent 87eaa04 commit 4876e3b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object Hashable {
2828
trait Hashable {
2929
import Hashable._
3030

31-
protected def hashSeed: Int = getClass.getSimpleName.hashCode
31+
protected def hashSeed: Int = getClass.hashCode
3232

3333
protected final def finishHash(hashCode: Int, arity: Int): Int =
3434
avoidNotCached(hashing.finalizeHash(hashCode, arity))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ object Uniques {
9292
}
9393

9494
final class RefinedUniques extends HashSet[RefinedType](Config.initialUniquesCapacity) with Hashable {
95-
override val hashSeed = "CachedRefinedType".hashCode // some types start life as CachedRefinedTypes, need to have same hash seed
95+
override val hashSeed = classOf[CachedRefinedType].hashCode // some types start life as CachedRefinedTypes, need to have same hash seed
9696
override def hash(x: RefinedType): Int = x.hash
9797

9898
private def findPrevious(h: Int, parent: Type, refinedName: Name, refinedInfo: Type): RefinedType = {

0 commit comments

Comments
 (0)