diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-11-10 16:42:27 +0100 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-11-10 16:43:34 +0100 |
commit | c11646c40042404550eb983577c9e7096a40502a (patch) | |
tree | 6817bbac0648acb50b42ac91dc6474388ecb8077 /src/dotty/tools/dotc | |
parent | 7cfd3cad248f4b82da61d324c2724e779ddc5fe0 (diff) | |
download | dotty-c11646c40042404550eb983577c9e7096a40502a.tar.gz dotty-c11646c40042404550eb983577c9e7096a40502a.tar.bz2 dotty-c11646c40042404550eb983577c9e7096a40502a.zip |
Make hash codes on type more predictable.
May help finding the partest issue.
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r-- | src/dotty/tools/dotc/core/Hashable.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Uniques.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Hashable.scala b/src/dotty/tools/dotc/core/Hashable.scala index 3eb08d774..f1af1e67d 100644 --- a/src/dotty/tools/dotc/core/Hashable.scala +++ b/src/dotty/tools/dotc/core/Hashable.scala @@ -28,7 +28,7 @@ object Hashable { trait Hashable { import Hashable._ - protected def hashSeed: Int = getClass.hashCode + protected def hashSeed: Int = getClass.getSimpleName.hashCode private def finishHash(hashCode: Int, arity: Int): Int = avoidNotCached(hashing.finalizeHash(hashCode, arity)) diff --git a/src/dotty/tools/dotc/core/Uniques.scala b/src/dotty/tools/dotc/core/Uniques.scala index b00508d60..0571100a3 100644 --- a/src/dotty/tools/dotc/core/Uniques.scala +++ b/src/dotty/tools/dotc/core/Uniques.scala @@ -92,7 +92,7 @@ object Uniques { } final class RefinedUniques extends HashSet[RefinedType](Config.initialUniquesCapacity) with Hashable { - override val hashSeed = classOf[CachedRefinedType].hashCode // some types start life as CachedRefinedTypes, need to have same hash seed + override val hashSeed = "CachedRefinedType".hashCode // some types start life as CachedRefinedTypes, need to have same hash seed override def hash(x: RefinedType): Int = x.hash private def findPrevious(h: Int, parent: Type, refinedName: Name, refinedInfo: Type): RefinedType = { |