-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Requestify AbstractStorageDecl::hasStorage()
.
#66529
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
DougGregor
merged 4 commits into
swiftlang:release/5.9
from
DougGregor:requestify-has-storage-5.9
Jun 12, 2023
Merged
Requestify AbstractStorageDecl::hasStorage()
.
#66529
DougGregor
merged 4 commits into
swiftlang:release/5.9
from
DougGregor:requestify-has-storage-5.9
Jun 12, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci please test |
The `hasStorage()` computation is used in many places to determine the signatures of other declarations. It currently needs to expand accessor macros, which causes a number of cyclic references. Provide a simplified request to determine `hasStorage` without expanding or resolving macros, breaking a common pattern of cycles when using macros. Fixes rdar://109668383.
… impl info Slightly cleanup, and make an assertion less strict in the face of invalid code.
Now that we've made accessor macro expansion more lazy, ensure that when querying for init accessors (e.g., to build a memberwise initializer), we also expand any accessor macros that might produce an init accessor. This is a partial step toward the real goal, which is that `AbstractStorageDecl::getAccessor()` should lazily expand macros if needed. Update the Observable macro to document that it produces an `init` accessor.
Remove an early iteration of cycle-breaking in `PatternBindingEntryRequest` that has been subsumed by the lazy computation of `AbstractStorageDecl::hasStorage()`. We can now directly use `hasStorage()` here.
8702fe7
to
beeadb2
Compare
@swift-ci please test |
@swift-ci please test Windows |
@swift-ci please test |
Prior test run looks like it tripped over some CI issues, trying again |
@swift-ci please test Windows |
1 similar comment
@swift-ci please test Windows |
hborla
approved these changes
Jun 12, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
hasStorage()
computation is used in many places to determine the signatures of other declarations. It currently needs to expand accessor macros, which causes a number of cyclic references. Provide a simplified request to determinehasStorage
without expanding or resolving macros, breaking a common pattern of cycles when using macros. This requires some level of additional documentation for accessor macros to say what accessors they could generate, because we need to know whether a given accessor macro will make a property computed (or not) without expanding it. There is a small-but-necessary language adjustment to be paired with this.hasStorage()
computation is core to determining whether a particular property is stored or not. Its value was determined based on a heavier-weight computation of the access pattern for the property, which required creating all accessors in advance.hasStorage
computation could be out-of-sync with the access-pattern computation in some corner case not exercised by any code we've tested, causing a regression. ThehasStorage
computation is so central to everything in the compiler that this seems unlikely.AbstractStorageDecl::hasStorage()
. #66482