File tree 2 files changed +14
-2
lines changed
compiler/src/dotty/tools/dotc/parsing
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -1104,9 +1104,14 @@ object Parsers {
1104
1104
if (prec < opPrec || leftAssoc && prec == opPrec) {
1105
1105
opStack = opStack.tail
1106
1106
recur {
1107
- atSpan(opInfo.operator.span union opInfo.operand.span union top.span) {
1107
+ atSpan(opInfo.operator.span union opInfo.operand.span union top.span):
1108
+ def deprecateInfixNamedArg (t : Tree ): Unit = t match
1109
+ case Tuple (ts) => ts.foreach(deprecateInfixNamedArg)
1110
+ case Parens (t) => deprecateInfixNamedArg(t)
1111
+ case t : Assign => report.deprecationWarning(em " named argument is deprecated for infix syntax " , t.srcPos)
1112
+ case _ =>
1113
+ deprecateInfixNamedArg(top)
1108
1114
InfixOp (opInfo.operand, opInfo.operator, top)
1109
- }
1110
1115
}
1111
1116
}
1112
1117
else top
Original file line number Diff line number Diff line change
1
+ //> using options -deprecation
2
+
3
+ class C {
4
+ def f = 42 + (x = 1 ) // warn
5
+ def multi (x : Int , y : Int ): Int = x + y
6
+ def g = new C () `multi` (x = 42 , y = 27 ) // warn // warn
7
+ }
You can’t perform that action at this time.
0 commit comments