Skip to content

Commit 2acf776

Browse files
committed
Change autoTuplingEnabled to only apply to tupling
Untupling of infix operators is no longer under the noAutoTupling language feature. Instead, we always untuple if the infix operator is not unary. The idea is that, going forward we will gradually remove infix operators that are not unary. Once that is done completely, and there are no more backwards compatibility concerbs, the code to untuple arguments of infix operations will become dead code and can be removed.
1 parent 5ec25bd commit 2acf776

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,7 @@ class Typer extends Namer
29382938
* - we untuple tuple arguments of infix operations if the function
29392939
* does not consist only of unary alternatives.
29402940
*/
2941-
def needsTupledDual(funType: Type, pt: FunProto): Boolean = {
2941+
def needsTupledDual(funType: Type, pt: FunProto): Boolean =
29422942
pt.args match
29432943
case untpd.Tuple(elems) :: Nil =>
29442944
elems.length > 1
@@ -2947,7 +2947,7 @@ class Typer extends Namer
29472947
case args =>
29482948
args.lengthCompare(1) > 0
29492949
&& isUnary(funType)
2950-
} && autoTuplingEnabled
2950+
&& autoTuplingEnabled
29512951

29522952
def adaptToArgs(wtp: Type, pt: FunProto): Tree = wtp match {
29532953
case wtp: MethodOrPoly =>

0 commit comments

Comments
 (0)