Skip to content

Adapted multiarg infix is just a tuple#9640

Merged
lrytz merged 1 commit intoscala:2.13.xfrom
som-snytt:tweak/infix-tuple
May 25, 2021
Merged

Adapted multiarg infix is just a tuple#9640
lrytz merged 1 commit intoscala:2.13.xfrom
som-snytt:tweak/infix-tuple

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