From 709c657b3963ec3d3d4f0933fe05bf25f697b48f Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 19 May 2015 17:56:23 +0200 Subject: Add equals and hashcode to LazyRef --- src/dotty/tools/dotc/core/Types.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index d5e0e3eba..792029ee4 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1787,6 +1787,11 @@ object Types { lazy val ref = refFn() override def underlying(implicit ctx: Context) = ref override def toString = s"LazyRef($ref)" + override def equals(other: Any) = other match { + case other: LazyRef => this.ref.equals(other.ref) + case _ => false + } + override def hashCode = ref.hashCode + 37 } // --- Refined Type --------------------------------------------------------- -- cgit v1.2.3