|
12 | 12 | //
|
13 | 13 | // This file implements type witness lookup and associated type inference.
|
14 | 14 | //
|
| 15 | +// There are three entry points into the code here, all via request evaluation: |
| 16 | +// |
| 17 | +// - TypeWitnessRequest resolves a type witness in a normal conformance. |
| 18 | +// - First, we perform a qualified lookup into the conforming type to find a |
| 19 | +// member type with the same name as the associated type. |
| 20 | +// - If the lookup succeeds, we record the type witness. |
| 21 | +// - If the lookup fails, we attempt to resolve all type witnesses. |
| 22 | +// |
| 23 | +// - ResolveTypeWitnessesRequest resolves all type witnesses of a normal |
| 24 | +// conformance. |
| 25 | +// - First, we attempt to resolve each associated type via lookup. |
| 26 | +// - For any witnesses still unresolved, we perform associated type inference. |
| 27 | +// |
| 28 | +// - AssociatedConformanceRequest resolves an associated conformance of a |
| 29 | +// normal conformance. This computes the substituted subject type and performs |
| 30 | +// a global conformance lookup. |
| 31 | +// |
15 | 32 | //===----------------------------------------------------------------------===//
|
16 | 33 | #include "TypeCheckProtocol.h"
|
17 | 34 | #include "DerivedConformances.h"
|
@@ -3942,6 +3959,10 @@ TypeWitnessSystem::compareResolvedTypes(Type ty1, Type ty2) {
|
3942 | 3959 | return ResolvedTypeComparisonResult::EquivalentOrWorse;
|
3943 | 3960 | }
|
3944 | 3961 |
|
| 3962 | +// |
| 3963 | +// Request evaluator entry points |
| 3964 | +// |
| 3965 | + |
3945 | 3966 | evaluator::SideEffect
|
3946 | 3967 | ResolveTypeWitnessesRequest::evaluate(Evaluator &evaluator,
|
3947 | 3968 | NormalProtocolConformance *conformance) const {
|
|
0 commit comments