@@ -671,7 +671,7 @@ object Parsers {
671671 else leading :: Nil
672672
673673 def maybeNamed (op : () => Tree ): () => Tree = () =>
674- if isIdent && in.lookahead.token == EQUALS && in.featureEnabled( Feature .namedTuples) then
674+ if isIdent && in.lookahead.token == EQUALS && sourceVersion.enablesNamedTuples then
675675 atSpan(in.offset):
676676 val name = ident()
677677 in.nextToken()
@@ -1137,32 +1137,15 @@ object Parsers {
11371137 if (prec < opPrec || leftAssoc && prec == opPrec) {
11381138 opStack = opStack.tail
11391139 recur {
1140- migrateInfixOp(opInfo, isType):
1141- atSpan(opInfo.operator.span union opInfo.operand.span union top.span):
1142- InfixOp (opInfo.operand, opInfo.operator, top)
1140+ atSpan(opInfo.operator.span union opInfo.operand.span union top.span):
1141+ InfixOp (opInfo.operand, opInfo.operator, top)
11431142 }
11441143 }
11451144 else top
11461145 }
11471146 recur(top)
11481147 }
11491148
1150- private def migrateInfixOp (opInfo : OpInfo , isType : Boolean )(infixOp : InfixOp ): Tree = {
1151- def isNamedTupleOperator = opInfo.operator.name match
1152- case nme.EQ | nme.NE | nme.eq | nme.ne | nme.`++` | nme.zip => true
1153- case _ => false
1154- if isType then infixOp
1155- else infixOp.right match
1156- case Tuple (args) if args.exists(_.isInstanceOf [NamedArg ]) && ! isNamedTupleOperator =>
1157- report.errorOrMigrationWarning(DeprecatedInfixNamedArgumentSyntax (), infixOp.right.srcPos, MigrationVersion .AmbiguousNamedTupleSyntax )
1158- if MigrationVersion .AmbiguousNamedTupleSyntax .needsPatch then
1159- val asApply = cpy.Apply (infixOp)(Select (opInfo.operand, opInfo.operator.name), args)
1160- patch(source, infixOp.span, asApply.show(using ctx.withoutColors))
1161- asApply // allow to use pre-3.6 syntax in migration mode
1162- else infixOp
1163- case _ => infixOp
1164- }
1165-
11661149 /** True if we are seeing a lambda argument after a colon of the form:
11671150 * : (params) =>
11681151 * body
@@ -2177,7 +2160,7 @@ object Parsers {
21772160
21782161 if namedOK && isIdent && in.lookahead.token == EQUALS then
21792162 commaSeparated(() => namedArgType())
2180- else if tupleOK && isIdent && in.lookahead.isColon && in.featureEnabled( Feature .namedTuples) then
2163+ else if tupleOK && isIdent && in.lookahead.isColon && sourceVersion.enablesNamedTuples then
21812164 commaSeparated(() => namedElem())
21822165 else
21832166 commaSeparated(() => argType())
0 commit comments