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

Make the method ## have no parameter list (instead of a single empty one) #8814

Merged
merged 1 commit into from Apr 3, 2020

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Mar 19, 2020

In Dotty, the method ## has no parameter list (instead of having a single empty one), so this aligns Scala 2.13 to that. It would appear calling .##() is highly unlikely so this was changed to error immediately (no warnings).

@scala-jenkins scala-jenkins added this to the 2.13.3 milestone Mar 19, 2020
@dwijnand

This comment has been minimized.

@eed3si9n
Copy link
Member

https://github.com/scala/scala/blob/2.13.x/src/library-aux/scala/Any.scala should be updated together for documentation purpose - scala/bug#5077

@dwijnand dwijnand force-pushed the make-##-nullary branch 2 times, most recently from 29ccdbf to 075545f Compare March 20, 2020 08:20
Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise! I wonder how breaking this change will be, i.e., how many ##() are out there. Community build will hopefully give us an idea. Maybe we can make a special case in the type checker to allow it with a deprecation warning.

test/files/neg/t7187-deprecation.scala Outdated Show resolved Hide resolved
test/files/neg/t7187-deprecation.scala Outdated Show resolved Hide resolved
@dwijnand
Copy link
Member Author

dwijnand commented Mar 20, 2020

@lrytz
Copy link
Member

lrytz commented Apr 3, 2020

The community build seems fine. Since ## is final we don't have to worry about overriding. The breaking change is that x.##() no longer compiles. Do we need to worry about this? Intuitively this should affect very few codebases, but unfortunately it's a rough breakage (error, not just a warning).

@SethTisue should we include this in 2.13.2? Scalafix-it?

@lrytz lrytz modified the milestones: 2.13.3, 2.13.2 Apr 3, 2020
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Apr 3, 2020
@SethTisue SethTisue changed the title Make {Any,Object}.## nullary Make {Any,Object}.## have no argument list (instead of a single empty one) Apr 3, 2020
@SethTisue SethTisue merged commit b6c6486 into scala:2.13.x Apr 3, 2020
@SethTisue
Copy link
Member

let's roll

@dwijnand would you mind adding a PR description that motivates the change a bit? doesn't need to be extensive, but if we're going to annoy people with a fiddly-seeming change like this, we should say what it's in service of.

@dwijnand dwijnand deleted the make-##-nullary branch April 3, 2020 15:04
@dwijnand dwijnand changed the title Make {Any,Object}.## have no argument list (instead of a single empty one) Make the method ## have no parameter list (instead of a single empty one) Apr 3, 2020
@dwijnand
Copy link
Member Author

dwijnand commented Apr 4, 2020

Scalafix-it?

Done-zo: lightbend-labs/scala-rewrites#16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
5 participants