[Diagnostics] In DefineMemberBasedOnUse::diagnoseForAmbiguity, use

the base type from each solution instead of only the base type from
the first solution.
This commit is contained in:
Holly Borla
2020-04-06 17:35:31 -07:00
parent 829f2588b3
commit 6375481ea4
4 changed files with 37 additions and 11 deletions

View File

@@ -2983,8 +2983,9 @@ bool ConstraintSystem::diagnoseAmbiguityWithFixes(
bool diagnosed = false;
for (auto fixes: aggregatedFixes) {
// A common fix must appear in all solutions
if (fixes.second.size() < solutions.size()) continue;
diagnosed |= fixes.second.front()->diagnoseForAmbiguity(solutions);
if (fixes.second.size() != solutions.size()) continue;
diagnosed |= fixes.second.front()->diagnoseForAmbiguity(solutions,
fixes.second);
}
return diagnosed;
}