Skip to content

Kill the LazyResolver #28092

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 3 commits into from
Nov 6, 2019
Merged

Kill the LazyResolver #28092

merged 3 commits into from
Nov 6, 2019

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Nov 5, 2019

Put the final nail in the LazyResolver's coffin. Devirtualize all remaining uses of the LazyResolver, and replace it with the concept of a "legacy global type checker" instance. Finally, to support that notion, make TypeChecker behave more like a singleton than it does today.

This is built on top of a rebased copy of #28009.

Witness matching is a source of a lot of ad-hoc cycles, and mixes the
logic that performs resolution, caching, validation, and cycle detection into one
place.  To make matters worse, some checkers kick off other checks in
order to cache work for further declarations, and access an internal
cache on their subject conformance for many requirements at once, or
sometimes just one requirement.

None of this fits into the request evaluator's central view of the
caching.  This is further evidenced by the fact that if you attempt to
move the caching step into the evaluator, it overcaches the same
witness and trips asserts.

As a start, define requests for the resolution steps, and flush some
hacks around forcing witness resolution. The caching logic is mostly
untouched (the requests don't actually cache anything), but some cycle
breaking is now handled in the evaluator itself.  Once witness matching
has been refactored to cache with the evaluator, all of these hacks can
go away.

My urge to destroy the LazyResolver outweighs the compromises here.
@CodaFi CodaFi requested a review from DougGregor November 5, 2019 22:52
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 5, 2019

@swift-ci please test

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 5, 2019

@swift-ci please test source compatibility

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 6, 2019

⛵️

@CodaFi CodaFi merged commit 06378ae into swiftlang:master Nov 6, 2019
@CodaFi CodaFi deleted the typing-of-the-dead branch November 6, 2019 03:54
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