Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate multi-parameter infix operations #503

Closed
adriaanm opened this issue May 10, 2018 · 12 comments
Closed

deprecate multi-parameter infix operations #503

adriaanm opened this issue May 10, 2018 · 12 comments
Milestone

Comments

@adriaanm
Copy link
Contributor

adriaanm commented May 10, 2018

use a tuple instead

this enables a better story for auto-tupling (scala/scala3#4311)

deprecation path (for a given -Xsource level):

  • 2.14:
    • deprecation warning: application involving a multi-param infix operation
  • 3.0:
    • behavior change: application involving a multi-param infix operation is only allowed if the method takes a single argument, args are tupled
    • warning: definition of a symbolic method with multiple params ("cannot be used infix")
@adriaanm adriaanm added this to the 2.14 milestone May 10, 2018
@adriaanm
Copy link
Contributor Author

adriaanm commented Nov 3, 2018

@smarter suggests we start warning on definition in 2.13, this way library authors can either mark symbolic multi-param methods as @deprecated in their library (and thus not get the deprecation warning that scalac emits)

@adriaanm
Copy link
Contributor Author

adriaanm commented Nov 3, 2018

note that the 2.14 warning shouldn't fire on method that take a single argument list, since those will still be ok in 3.0

@adriaanm
Copy link
Contributor Author

adriaanm commented Nov 3, 2018

the main goal being that the following applications will remain accepted during the whole upgrade (for time-varying reasons)

(x, y) :: xs
a == (b ,c)

the following will warn / error over time:

x += (1, 2, 3)
x add (a, b, c)

(because they take multiple arguments)

@SethTisue
Copy link
Member

new proposal at scala/scala3#4311 (comment)

@SethTisue SethTisue modified the milestones: 2.14, 2.13.0-RC1 Dec 6, 2018
@SethTisue
Copy link
Member

note that new proposal includes a 2.13 change (warning on definition)

@SethTisue
Copy link
Member

@adriaanm where do we stand on this for RC1?

@adriaanm
Copy link
Contributor Author

This will need to wait until later in 2.13.x

@eed3si9n
Copy link
Member

Since we are shipping a bunch of collection changes in 2.13, and multi-parameter +s are already on deprecation track, I sent a PR to replace them with custom compilation error telling ppl to use ++ instead - scala/scala#7790

eed3si9n added a commit to eed3si9n/scala that referenced this issue Feb 24, 2019
Ref scala/scala-dev#503

As a preparatory step towards multi-parameter infix notation, this will deprecate the declaration of symbolic method so the library authors can either mark symbolic multi-param methods as `@deprecated` in their library or migrate to something else.
eed3si9n added a commit to eed3si9n/scala that referenced this issue Feb 24, 2019
Ref scala/scala-dev#503

As a preparatory step towards multi-parameter infix notation, this will deprecate the declaration of symbolic method so the library authors can either mark symbolic multi-param methods as `@deprecated` in their library or migrate to something else.
@eed3si9n
Copy link
Member

Here's a PR to deprecate multi-parameter symbolic method decl - scala/scala#7792

@eed3si9n
Copy link
Member

Here's deprecation on the application side under -Xsource:2.14 - scala/scala#7795

@szeiger szeiger modified the milestones: 2.13.1, 2.13.2 Sep 9, 2019
@SethTisue SethTisue modified the milestones: 2.13.2, 2.13.3 Feb 6, 2020
@som-snytt
Copy link

Somewhere I threatened a lint if deprecation was dropped.

scala/scala#8951

@SethTisue SethTisue modified the milestones: 2.13.3, 2.13.4 May 15, 2020
@dwijnand dwijnand removed this from the 2.13.4 milestone Oct 16, 2020
@dwijnand dwijnand added this to the Backlog milestone Oct 16, 2020
@SethTisue
Copy link
Member

out of scope for Scala 2

@SethTisue SethTisue closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants