mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostics] Diagnose ambiguous solutions with warnings like regular ambiguities
If solutions either have no fixes at all or all of the are warnings, let's use `diagnoseAmbiguity` to diagnose such cases as-if there are no fixes at all. Resolves: rdar://79657350
This commit is contained in:
@@ -3911,6 +3911,16 @@ bool ConstraintSystem::diagnoseAmbiguityWithFixes(
|
||||
}
|
||||
}
|
||||
|
||||
// If there either no fixes at all or all of the are warnings,
|
||||
// let's diagnose this as regular ambiguity.
|
||||
if (llvm::all_of(solutions, [](const Solution &solution) {
|
||||
return llvm::all_of(solution.Fixes, [](const ConstraintFix *fix) {
|
||||
return fix->isWarning();
|
||||
});
|
||||
})) {
|
||||
return diagnoseAmbiguity(solutions);
|
||||
}
|
||||
|
||||
// Algorithm is as follows:
|
||||
//
|
||||
// a. Aggregate all of the available fixes based on callee locator;
|
||||
|
||||
Reference in New Issue
Block a user