Skip to content

Commit 85afcb1

Browse files
committed
Sema: Add comment to AssociatedTypeInference.cpp
1 parent 979fc28 commit 85afcb1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

lib/Sema/AssociatedTypeInference.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@
1212
//
1313
// This file implements type witness lookup and associated type inference.
1414
//
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+
//
1532
//===----------------------------------------------------------------------===//
1633
#include "TypeCheckProtocol.h"
1734
#include "DerivedConformances.h"
@@ -3942,6 +3959,10 @@ TypeWitnessSystem::compareResolvedTypes(Type ty1, Type ty2) {
39423959
return ResolvedTypeComparisonResult::EquivalentOrWorse;
39433960
}
39443961

3962+
//
3963+
// Request evaluator entry points
3964+
//
3965+
39453966
evaluator::SideEffect
39463967
ResolveTypeWitnessesRequest::evaluate(Evaluator &evaluator,
39473968
NormalProtocolConformance *conformance) const {

0 commit comments

Comments
 (0)