Skip to content

[Sema] Fix optional chaining behavior with postfix operators #80303

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
Mar 26, 2025

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Mar 26, 2025

Postfix operators can further be chained within an optional binding chain, so we need to make sure they're handled in getMemberChainSubExpr. Unresolved member chains still don't allow them, so we need to add a new kind parameter to differentiate the behavior here.

rdar://147826988
Resolves #80265

Postfix operators can further be chained within an optional binding
chain, so we need to make sure they're handled in
`getMemberChainSubExpr`. Unresolved member chains still don't allow
them, so we need to add a new `kind` parameter to differentiate the
behavior here.

rdar://147826988
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please test source compatibility

Copy link
Member

@rintaro rintaro left a comment

Choose a reason for hiding this comment

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

Thank you!

@hamishknight hamishknight enabled auto-merge March 26, 2025 21:14
@hamishknight hamishknight merged commit 1de7b3f into swiftlang:main Mar 26, 2025
5 of 7 checks passed
@hamishknight hamishknight deleted the off-the-chain branch March 26, 2025 23:38
@muukii
Copy link

muukii commented Mar 31, 2025

Which Xcode will include this fix? seems Xcode 16.2 does not include this.

@hamishknight
Copy link
Contributor Author

This will be part of release/6.2, see the 6.2 release process forum post for more info

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.

Behavior of postfix operator has been changed in Swift6.1
4 participants