@@ -732,10 +732,31 @@ AllowFunctionTypeMismatch::create(ConstraintSystem &cs, Type lhs, Type rhs,
732732 AllowFunctionTypeMismatch (cs, lhs, rhs, locator, index);
733733}
734734
735+ bool GenericArgumentsMismatch::coalesceAndDiagnose (
736+ const Solution &solution, ArrayRef<ConstraintFix *> secondaryFixes,
737+ bool asNote) const {
738+ std::set<unsigned > scratch (getMismatches ().begin (), getMismatches ().end ());
739+
740+ for (auto *fix : secondaryFixes) {
741+ auto *genericArgsFix = fix->castTo <GenericArgumentsMismatch>();
742+ for (auto mismatchIdx : genericArgsFix->getMismatches ())
743+ scratch.insert (mismatchIdx);
744+ }
745+
746+ SmallVector<unsigned > mismatches (scratch.begin (), scratch.end ());
747+ return diagnose (solution, mismatches, asNote);
748+ }
749+
750+ bool GenericArgumentsMismatch::diagnose (const Solution &solution,
751+ bool asNote) const {
752+ return diagnose (solution, getMismatches (), asNote);
753+ }
754+
735755bool GenericArgumentsMismatch::diagnose (const Solution &solution,
756+ ArrayRef<unsigned > mismatches,
736757 bool asNote) const {
737758 GenericArgumentsMismatchFailure failure (solution, getFromType (), getToType (),
738- getMismatches () , getLocator ());
759+ mismatches , getLocator ());
739760 return failure.diagnose (asNote);
740761}
741762
0 commit comments