diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 8eb5ce8aee8d..8525c35f035f 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2099,7 +2099,8 @@ object Parsers { def condExpr(altToken: Token): Tree = val t: Tree = if in.token == LPAREN then - var t: Tree = atSpan(in.offset) { Parens(inParens(exprInParens())) } + var t: Tree = atSpan(in.offset): + makeTupleOrParens(inParensWithCommas(commaSeparated(exprInParens))) if in.token != altToken then if toBeContinued(altToken) then t = inSepRegion(InCond) { diff --git a/tests/pos/if-parse.scala b/tests/pos/if-parse.scala new file mode 100644 index 000000000000..9a99f6e216f5 --- /dev/null +++ b/tests/pos/if-parse.scala @@ -0,0 +1,4 @@ +import scala.math.Ordering.Implicits.infixOrderingOps + +def test = + if (1, 2) < (3, 4) then 1 else 2