Skip to content

Commit cf3f52c

Browse files
committed
[ConstraintSystem] NFC: Leave notes on the algorithm used by diagnoseAmbiguityWithFixes
1 parent 7d3f5e3 commit cf3f52c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3197,6 +3197,16 @@ bool ConstraintSystem::diagnoseAmbiguityWithFixes(
31973197
if (diagnoseAmbiguityWithEphemeralPointers(*this, solutions))
31983198
return true;
31993199

3200+
3201+
// Algorithm is as follows:
3202+
//
3203+
// a. Aggregate all of the available fixes based on callee locator;
3204+
// b. For each ambiguous overload match aggregated fixes and diagnose;
3205+
// c. Discard all of the fixes which have been already considered
3206+
// as part of overload diagnostics;
3207+
// d. Diagnose remaining (uniqued based on kind + locator) fixes
3208+
// iff they appear in all of the solutions.
3209+
32003210
using Fix = std::pair<const Solution *, const ConstraintFix *>;
32013211

32023212
llvm::SmallSetVector<Fix, 4> fixes;

0 commit comments

Comments
 (0)