diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index da6b20b75c29..2e9288dcd9be 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -280,7 +280,7 @@ object Applications { case argType :: Nil if args.lengthCompare(1) > 0 && Feature.autoTuplingEnabled - && defn.isTupleNType(argType) => + && (defn.isTupleNType(argType) || argType.isSmallGenericTuple) => untpd.Tuple(args) :: Nil case _ => args diff --git a/tests/pos/generic-untupling.scala b/tests/pos/generic-untupling.scala new file mode 100644 index 000000000000..b6002301baec --- /dev/null +++ b/tests/pos/generic-untupling.scala @@ -0,0 +1,8 @@ + +def foo(x: Option[(Int, Boolean)]) = x match + case Some(a, b) => ??? // was ok + case None => ??? + +def bar(x: Option[Int *: Boolean *: EmptyTuple]) = x match + case Some(a, b) => ??? // was error, now ok + case None => ???