Skip to content

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

Merged
merged 5 commits into from
Jul 24, 2019

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jul 23, 2019

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.

@slavapestov slavapestov force-pushed the storage-impl-info-request branch from 39eda2a to 309bc5c Compare July 23, 2019 03:19
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 309bc5c047fa6bf6fb786b75d385ba2bdd093838

@slavapestov slavapestov requested a review from rjmccall July 23, 2019 03:49
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 309bc5c047fa6bf6fb786b75d385ba2bdd093838

Copy link
Contributor

@rjmccall rjmccall left a 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.
@slavapestov slavapestov force-pushed the storage-impl-info-request branch from 309bc5c to 60e1dfe Compare July 23, 2019 20:18
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 309bc5c047fa6bf6fb786b75d385ba2bdd093838

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 309bc5c047fa6bf6fb786b75d385ba2bdd093838

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Linux

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 60e1dfe

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@slavapestov slavapestov merged commit e88f0c2 into swiftlang:master Jul 24, 2019
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.

3 participants