Skip to content

Infix call sites to non-infix methods don't warn by default, though doc claims they would in 3.1 #17429

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

Closed
SethTisue opened this issue May 7, 2023 · 1 comment · Fixed by #19247
Assignees
Labels
itype:bug Spree Suitable for a future Spree
Milestone

Comments

@SethTisue
Copy link
Member

at https://docs.scala-lang.org/scala3/reference/changed-features/operators.html , I read:

To smooth migration to Scala 3.0, alphanumeric operators will only be deprecated from Scala 3.1 onwards, or if the -source future option is given in Dotty/Scala 3.

But it seems this planned change hasn't taken place as of 3.3.0-RC5:

Welcome to Scala 3.3.0-RC5 (17.0.7, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                    
scala> case class A(a:Int):
     |   def plus(a:A) = A(this.a+a.a)
     | println(A(1) plus A(2))
A(3)
// defined case class A

scala> :reset -source:future -deprecation
...
-- Deprecation Warning: --------------------------------------------------------
3 |println(A(1) plus A(2))
  |             ^^^^
  |Alphanumeric method plus is not declared infix; it should not be used as infix operator.
  |Instead, use method syntax .plus(...) or backticked identifier `plus`.

This was reported on Discord today.

@SethTisue SethTisue added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels May 7, 2023
@odersky
Copy link
Contributor

odersky commented May 8, 2023

We decided to hold most incompatibility warnings wrt Scala 2 back until after the 3.3 LTS. So this should get in for 3.4.

@odersky odersky removed the stat:needs triage Every issue needs to have an "area" and "itype" label label May 8, 2023
@odersky odersky added this to the 3.4.0 milestone May 8, 2023
@dwijnand dwijnand added the Spree Suitable for a future Spree label Dec 11, 2023
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Dec 11, 2023
Alphanumeric infix operator syntax will warn from `3.4`.

Fixes scala#17429
dwijnand added a commit that referenced this issue Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants