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

Migration rewrites for infix arguments interpreted as named tuples #21949

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

WojciechMazur
Copy link
Contributor

@WojciechMazur WojciechMazur commented Nov 14, 2024

Resolves #21681
Resolves #21767 - fixes 5 out of 6 referenced projects. The only still failing project tarao/record4s is mostly made obsolete under Scala 3.6. It was defining a named tuples-like DSL

Best effort migration rewrites based on prior work in #21565

At this point, it's too late to deprecate named infix arguments. Let's produce warnings instead. We accept infix arguments that might be an argument of a named tuple, eg. zip, ++ or == - each of these takes a single argument with NamedTuple.

If accepted it should be backported to 3.6

@WojciechMazur WojciechMazur requested a review from mbovel November 14, 2024 17:03
Copy link
Member

@mbovel mbovel left a comment

Choose a reason for hiding this comment

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

Looks good to me!

compiler/src/dotty/tools/dotc/typer/ErrorReporting.scala Outdated Show resolved Hide resolved
Co-authored-by: Matt Bovel <[email protected]>
@WojciechMazur WojciechMazur merged commit 5d5a9e6 into scala:main Nov 18, 2024
29 checks passed
@WojciechMazur WojciechMazur deleted the rewrite/infix-named-args branch November 18, 2024 09:35
@WojciechMazur WojciechMazur added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Nov 18, 2024
@tgodzik tgodzik added the release-notes Should be mentioned in the release notes label Nov 18, 2024
WojciechMazur added a commit that referenced this pull request Nov 18, 2024
…21949)

Best effort migration rewrites based on prior work in #21565  

At this point, it's too late to deprecate named infix arguments. Let's
produce warnings instead. We accept infix arguments that might be an
argument of a named tuple, eg. `zip`, `++` or `==` - each of these takes
a single argument with NamedTuple.

---------

Co-authored-by: Som Snytt <[email protected]>
Co-authored-by: Matt Bovel <[email protected]>
[Cherry-picked 5d5a9e6]
@WojciechMazur WojciechMazur added backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Nov 18, 2024
WojciechMazur added a commit that referenced this pull request Nov 18, 2024
… tuples" to 3.6 (#21966)

Backports #21949 to the 3.6.2.

PR submitted by the release tooling.
@WojciechMazur WojciechMazur added backport:done This PR was successfully backported. and removed backport:accepted This PR needs to be backported, once it's been backported replace this tag by "backport:done" labels Nov 18, 2024
@WojciechMazur WojciechMazur added this to the 3.6.2 milestone Nov 18, 2024
KacperFKorban pushed a commit to dotty-staging/dotty that referenced this pull request Nov 20, 2024
…cala#21949)

Best effort migration rewrites based on prior work in scala#21565  

At this point, it's too late to deprecate named infix arguments. Let's
produce warnings instead. We accept infix arguments that might be an
argument of a named tuple, eg. `zip`, `++` or `==` - each of these takes
a single argument with NamedTuple.

---------

Co-authored-by: Som Snytt <[email protected]>
Co-authored-by: Matt Bovel <[email protected]>
WojciechMazur added a commit that referenced this pull request Nov 28, 2024
Resolves #22042

* Reverts most of the stabilization changes introduced in
#21680 excluding bugfixes introduced
when stabilizing the name tuples
* Adapts #21823 and
#21949 warnings to make them both
syntax deprecations instead of ambiguous syntax.
* Adds automatic rewrite to #21823
to replace `(foo = bar)` into `{foo = bar}`
KacperFKorban pushed a commit to dotty-staging/dotty that referenced this pull request Nov 29, 2024
…cala#21949)

Best effort migration rewrites based on prior work in scala#21565  

At this point, it's too late to deprecate named infix arguments. Let's
produce warnings instead. We accept infix arguments that might be an
argument of a named tuple, eg. `zip`, `++` or `==` - each of these takes
a single argument with NamedTuple.

---------

Co-authored-by: Som Snytt <[email protected]>
Co-authored-by: Matt Bovel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported. release-notes Should be mentioned in the release notes
Projects
None yet
4 participants