Skip to content

Wrong infix argument lists are deprecated warning when constructing a Tuple2 with -> and a named tuple as the argument #25240

@arainko

Description

@arainko

Compiler version

3.7.4, 3.8.1

Minimized code

//> using scala 3.8.1
val test = 1 -> (field1 = 1)

Output

$ scala compile .
Compiling project (Scala 3.8.1, JVM (17))
[warn] ./falseWarn.scala:3:17
[warn] Deprecated syntax: infix named arguments lists are deprecated; since 3.7 it is interpreted as a single name tuple argument.
[warn] To avoid this warning, either remove the argument names or use dotted selection.
[warn] This can be rewritten automatically under -rewrite -source 3.7-migration.
[warn] val test = 1 -> (field1 = 1)
[warn]                 ^^^^^^^^^^^^
Compiled project (Scala 3.8.1, JVM (17))

Expectation

No warning in this case, I'm trying to construct a pair with a named tuple on the right side.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions