diff --git a/compiler/src/dotty/tools/dotc/util/SimpleIdentitySet.scala b/compiler/src/dotty/tools/dotc/util/SimpleIdentitySet.scala index 29df005fc856..8968f7196f73 100644 --- a/compiler/src/dotty/tools/dotc/util/SimpleIdentitySet.scala +++ b/compiler/src/dotty/tools/dotc/util/SimpleIdentitySet.scala @@ -59,7 +59,7 @@ object SimpleIdentitySet { private class Set3[+Elem <: AnyRef](x0: AnyRef, x1: AnyRef, x2: AnyRef) extends SimpleIdentitySet[Elem] { def size = 3 def + [E >: Elem <: AnyRef](x: E): SimpleIdentitySet[E] = - if (contains(this)) this + if (contains(x)) this else { val xs = new Array[AnyRef](4) xs(0) = x0 @@ -113,4 +113,4 @@ object SimpleIdentitySet { while (i < size) { f(xs(i).asInstanceOf[Elem]); i += 1 } } } -} \ No newline at end of file +}