Skip to content

Infer ConcurrentValue conformances for structs and enums. #36226

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 9 commits into from
Mar 3, 2021

Conversation

DougGregor
Copy link
Member

When a struct or enum has only ConcurrentValue-conforming instance
data, infer conformance to ConcurrentValue.

LookupAllConformancesInContextRequest caches the results of performing
lookup of all of the conformances ascribed to a given iterable
declaration context. However, it was only used in a small number of
places, with most clients using a different API
(`getLocalConformances()`) that does not provide
caching, cycle detection, or dependency tracking.

Sink LookupAllConformancesInContextRequest lower in the stack, and
reimplement `getLocalConformances()` on top of it. This ensures that
all of the various queries go through the cached request and get the
benefits of the request-evaluator infrastructure.
…formances()

The uncached, rarely-used getLocalProtocols() does not benefit from
having its own distinct implementation. Reimplement it on top of
getLocalConformances() to simplify things and benefit from the
request-evaluator infrastructure.
When a struct or enum has only ConcurrentValue-conforming instance
data, infer conformance to ConcurrentValue.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

swift-ci commented Mar 2, 2021

Build failed
Swift Test Linux Platform
Git Sha - b5e4b08

@swift-ci
Copy link
Contributor

swift-ci commented Mar 2, 2021

Build failed
Swift Test OS X Platform
Git Sha - b5e4b08

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please test source compatibility

@DougGregor
Copy link
Member Author

w00t!

@DougGregor DougGregor merged commit 57404f0 into swiftlang:main Mar 3, 2021
@DougGregor DougGregor deleted the implicit-concurrent-value branch March 3, 2021 06:43
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.

2 participants