-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Use a request to compute AbstractStorageDecl::getImplInfo() #26282
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
Use a request to compute AbstractStorageDecl::getImplInfo() #26282
Conversation
39eda2a
to
309bc5c
Compare
@swift-ci Please test |
@swift-ci Please test source compatibility |
Build failed |
Build failed |
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.
This all looks right at a first glance, but I might need a second look. :)
Some requests are implemented in lib/Sema/, even if they don't require a LazyResolver. Be sure to register their request functions in SourceKit so that these requests can be kicked off when needed.
Soon this will be performed lazily as part of a request.
This just moves the code from the parser into a request. Sema will still overwrite the ImplInfo field for lazy properties and property wrappers; refactoring that is next.
309bc5c
to
60e1dfe
Compare
@swift-ci Please test |
@swift-ci Please test source compatibility |
Build failed |
Build failed |
@swift-ci Please test Linux |
@swift-ci Please smoke test macOS |
Build failed |
@swift-ci Please smoke test Linux |
Previously the ImplInfo was first set by the parser, then in some cases later updated by the type checker. For example, a lazy property would start out as a stored property (
hasStored()
returns true), then after type checking it was "lowered" to a computed property (hasStorage()
returns false).The goal is to do the StorageImplInfo computation using a request so it is always up to date and correct, merging some code from the parser together with some code that previously ran as part of
maybeAddAccessorsToStorage()
.This PR gets us most of the way there --
maybeAddAccessorsToStorage()
still updates the StorageImplInfo for lazy properties and property wrappers.Follow-up to #26235.