Skip to content

Adapted multiarg infix is just a tuple #9640

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

Merged
merged 1 commit into from
May 25, 2021

Conversation

som-snytt
Copy link
Contributor

Don't warn about this common idiom.

(42, 27) :: Nil     // nowarn

It will warn after tweaking how right-associative applications are type-checked.

Currently, parser pulls the arg into a temp val, so there is no adaptation.

After the tweak, the rewrite happens after typecheck of desugared application, so there is normal adaptation.

@scala-jenkins scala-jenkins added this to the 2.13.7 milestone May 24, 2021
@som-snytt
Copy link
Contributor Author

Extracted from the other PR, where the test looked like

// don't bug me about adapting a tuple when I wrote a tuple arg to infix
class `lukas warned me about this and I brushed him off but that was last year before pandemic` {
  def `tuple in infix expression must not warn` = (42, 27) :: Nil
}

@dwijnand
Copy link
Member

from the other PR

Which one?

@som-snytt
Copy link
Contributor Author

#7741 about to get refreshed

@som-snytt
Copy link
Contributor Author

/rebuild

@lrytz lrytz merged commit 744651d into scala:2.13.x May 25, 2021
@som-snytt som-snytt deleted the tweak/infix-tuple branch May 25, 2021 15:50
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

Successfully merging this pull request may close these issues.

4 participants