Skip to content

[Sema] Fold SequenceExpr in pre-checking pre-walk #75528

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 4 commits into from
Aug 1, 2024

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jul 27, 2024

Doing it in the post-walk meant we ended up walking the children twice, which led to duplicate diagnostics and incorrect inference of the level of application for function references. Move it to the pre-walk, ensuring that we resolve any operator references before folding.

Resolves #75527

@hamishknight hamishknight changed the title [DNM] Fold SequenceExpr during pre-walk [Sema] Fold SequenceExpr in pre-checking pre-walk Jul 28, 2024
Sink forbidden prefix and `init` recovery into
`resolveDeclRefExpr`, and move diagnosis of `self`
in an `init` accessor into the pre-checking
post-walk such that it applies to any DeclRefExpr.
Doing it in the post-walk meant we ended up
walking the children twice, which lead to duplicate
diagnostics and incorrect inference of the
level of application for function references. Move
it to the pre-walk, ensuring that we resolve any
operator references before folding.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

@hamishknight hamishknight marked this pull request as ready for review July 29, 2024 09:28
@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test

@hamishknight hamishknight enabled auto-merge July 31, 2024 21:46
@hamishknight hamishknight merged commit 79be21f into swiftlang:main Aug 1, 2024
7 checks passed
@hamishknight hamishknight deleted the foldable-tangent branch August 1, 2024 08:46
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.

Function argument labels escape when using curried application in SequenceExpr
2 participants