-
Notifications
You must be signed in to change notification settings - Fork 10.5k
CS: optional
storage key path components are read-only
#42363
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
CS: optional
storage key path components are read-only
#42363
Conversation
@swift-ci please smoke test |
a496021
to
4a0f6ce
Compare
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.
Looks good, thanks!
@swift-ci Please test |
@swift-ci please clean test macOS |
Should I bring this over to 5.7? |
@AnthonyLatsis If you have time, sure! The failure on the Linux bot looks unrelated, I'll re-run the tests when #42370 is merged. |
@swift-ci Please test |
@swift-ci please test macOS |
macOS timed out on some url. |
@swift-ci please test source compatibility |
Hi Anthony! Sorry to bother you again, but we got a report that, with this follow-up fix applied, the compiler crashes on code that looks like this:
It isn't obvious to my eyes how, but possibly these changes also made it so that protocol conformance checking thinks that an optional get-set property requirement can be satisfied by a read-only property implementation? |
Forming a key path to an optional property can still trigger a crash as well:
|
From more experimentation it looks like there may be a remaining issue with properties whose types are bridged, like |
Oof, lucky someone caught this so fast. Thanks for sharing, will start debugging all this by tomorrow! |
@jckarter Do you have any tips on how to reproduce the Edit: Never mind, turns out my previous commit fixed that as well 🤦🏼♂️ |
Sorry, do you mean the previous PR, or a commit not included in this PR? |
A local commit that I thought would only fix the conformance issue. |
...because
optional
storage requirements do not support mutations in Swift.