@@ -732,10 +732,31 @@ AllowFunctionTypeMismatch::create(ConstraintSystem &cs, Type lhs, Type rhs,
732
732
AllowFunctionTypeMismatch (cs, lhs, rhs, locator, index);
733
733
}
734
734
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
+
735
755
bool GenericArgumentsMismatch::diagnose (const Solution &solution,
756
+ ArrayRef<unsigned > mismatches,
736
757
bool asNote) const {
737
758
GenericArgumentsMismatchFailure failure (solution, getFromType (), getToType (),
738
- getMismatches () , getLocator ());
759
+ mismatches , getLocator ());
739
760
return failure.diagnose (asNote);
740
761
}
741
762
0 commit comments