Skip to content

Commit f8d65ff

Browse files
committed
Add equals and hashcode to LazyRef
1 parent 68d0ed1 commit f8d65ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,6 +1787,11 @@ object Types {
17871787
lazy val ref = refFn()
17881788
override def underlying(implicit ctx: Context) = ref
17891789
override def toString = s"LazyRef($ref)"
1790+
override def equals(other: Any) = other match {
1791+
case other: LazyRef => this.ref.equals(other.ref)
1792+
case _ => false
1793+
}
1794+
override def hashCode = ref.hashCode + 37
17901795
}
17911796

17921797
// --- Refined Type ---------------------------------------------------------

0 commit comments

Comments
 (0)