Skip to content

Commit 2318433

Browse files
authored
Merge pull request #4488 from dotty-staging/fix-self-comparison
Fix typo in SimpleIdentitySet
2 parents 474e79a + f8d9a81 commit 2318433

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/util/SimpleIdentitySet.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object SimpleIdentitySet {
5959
private class Set3[+Elem <: AnyRef](x0: AnyRef, x1: AnyRef, x2: AnyRef) extends SimpleIdentitySet[Elem] {
6060
def size = 3
6161
def + [E >: Elem <: AnyRef](x: E): SimpleIdentitySet[E] =
62-
if (contains(this)) this
62+
if (contains(x)) this
6363
else {
6464
val xs = new Array[AnyRef](4)
6565
xs(0) = x0
@@ -113,4 +113,4 @@ object SimpleIdentitySet {
113113
while (i < size) { f(xs(i).asInstanceOf[Elem]); i += 1 }
114114
}
115115
}
116-
}
116+
}

0 commit comments

Comments
 (0)