mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
7.7 KiB
7.7 KiB