aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-19 17:56:23 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-21 17:41:16 +0200
commit709c657b3963ec3d3d4f0933fe05bf25f697b48f (patch)
treea03327bc05640856fbff5e5d299c060e02456856 /src
parent53496b83e62b06435800d11069a64f529c29f03f (diff)
downloaddotty-709c657b3963ec3d3d4f0933fe05bf25f697b48f.tar.gz
dotty-709c657b3963ec3d3d4f0933fe05bf25f697b48f.tar.bz2
dotty-709c657b3963ec3d3d4f0933fe05bf25f697b48f.zip
Add equals and hashcode to LazyRef
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala5
1 files changed, 5 insertions, 0 deletions
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 ---------------------------------------------------------