Skip to content

Commit 856ba1c

Browse files
authored
Merge pull request #14909 from dotty-staging/fix-14903
Cache skolem types
2 parents d5fcfcf + 16bb3d5 commit 856ba1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4622,11 +4622,12 @@ object Types {
46224622
* Note that care is needed when creating them, since not all types need to be inhabited.
46234623
* A skolem is equal to itself and no other type.
46244624
*/
4625-
case class SkolemType(info: Type) extends UncachedProxyType with ValueType with SingletonType {
4625+
case class SkolemType(info: Type) extends CachedProxyType with ValueType with SingletonType {
46264626
override def underlying(using Context): Type = info
46274627
def derivedSkolemType(info: Type)(using Context): SkolemType =
46284628
if (info eq this.info) this else SkolemType(info)
4629-
override def hashCode: Int = System.identityHashCode(this)
4629+
4630+
override def computeHash(bs: Binders): Int = identityHash(bs)
46304631
override def equals(that: Any): Boolean = this.eq(that.asInstanceOf[AnyRef])
46314632

46324633
def withName(name: Name): this.type = { myRepr = name; this }

0 commit comments

Comments
 (0)