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
Remove The Parser Hack For If-Let #31760
Conversation
@swift-ci test |
@swift-ci test source compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙇🏻♂️
@swift-ci test source compatibility release |
Hm... so this is source breaking because we didn't catch
where |
@swift-ci test source compatibility release |
The parser used to rewrite if let x: T into if let x: T? This transformation is correct at face value, but relied on being able to construct TypeReprs with bogus source locations. Instead of having the parser kick semantic analysis into shape, let's perform this reinterpretation when we resolve if-let patterns in statement conditions.
Now that the parser no longer constructs invalid TypeReprs for if-lets, printing the annotation here will always reflect what the user actually wrote. rdar://62894516
Build failed |
Build failed |
@swift-ci smoke test |
@swift-ci test Windows |
⛵ |
The parser used to rewrite
into
This transformation is correct at face value, but relied on being able
to construct TypeReprs with bogus source locations. Instead of having
the parser kick semantic analysis into shape, let's perform this
reinterpretation when we resolve if-let patterns in statement
conditions.