Skip to content

Teach PostTyper to handle untupled context closures #17739

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 2 commits into from
Jun 6, 2023

Conversation

dwijnand
Copy link
Member

No description provided.

@dwijnand dwijnand linked an issue May 31, 2023 that may be closed by this pull request
@SethTisue
Copy link
Member

fwiw, Dale and I looked at this together and this fix seems elegant to me

the methods we're calling are more powerful than is strictly necessary here, but regardless, calling them seems more elegant than adding another case to the match (it would be a complicated case since the additional tree shape we're handling isn't a simple shape)

@dwijnand dwijnand marked this pull request as ready for review May 31, 2023 17:46
@dwijnand dwijnand requested a review from odersky May 31, 2023 17:46
tree match
case Select(qual, _) => check(qual) // simple select _n
case Apply(TypeApply(Select(qual, _), _), _) => check(qual) // generic select .apply[T](n)
appliedCore(closureBody(tree)) match
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a great fix. Since appliedCore is now used from outside TreeInfo, it would be good to give it a doc comment.

@odersky odersky assigned dwijnand and unassigned odersky Jun 5, 2023
@dwijnand dwijnand merged commit 0749271 into scala:main Jun 6, 2023
@dwijnand dwijnand deleted the untuple-ctx-fns branch June 6, 2023 08:48
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
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.

Parameter untupling with context function args
4 participants