Skip to content

Commit 9e3f86a

Browse files
committed
Special-case Tuple/NonEmptyTuple because they're so, so special
1 parent ca468b3 commit 9e3f86a

File tree

1 file changed

+2
-0
lines changed
  • compiler/src/dotty/tools/dotc/transform/patmat

1 file changed

+2
-0
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ class SpaceEngine(using Context) extends SpaceLogic {
631631
def getChildren(sym: Symbol): List[Symbol] =
632632
sym.children.flatMap { child =>
633633
if child eq sym then Nil // i3145: sealed trait Baz, val x = new Baz {}, Baz.children returns Baz...
634+
else if tp.classSymbol == defn.TupleClass || tp.classSymbol == defn.NonEmptyTupleClass then
635+
List(child) // TupleN and TupleXXL classes are used for Tuple, but they aren't Tuple's children
634636
else if (child.is(Private) || child.is(Sealed)) && child.isOneOf(AbstractOrTrait) then getChildren(child)
635637
else List(child)
636638
}

0 commit comments

Comments
 (0)