@@ -291,8 +291,10 @@ class ConstraintFix {
291
291
virtual bool diagnose (const Solution &solution,
292
292
bool asNote = false ) const = 0;
293
293
294
- virtual bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
295
- ArrayRef<ConstraintFix *> fixes) const {
294
+ using CommonFixesArray =
295
+ ArrayRef<std::pair<const Solution *, const ConstraintFix *>>;
296
+
297
+ virtual bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const {
296
298
return false ;
297
299
}
298
300
@@ -850,8 +852,7 @@ class DefineMemberBasedOnUse final : public ConstraintFix {
850
852
851
853
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
852
854
853
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
854
- ArrayRef<ConstraintFix *> fixes) const override ;
855
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override ;
855
856
856
857
static DefineMemberBasedOnUse *create (ConstraintSystem &cs, Type baseType,
857
858
DeclNameRef member, bool alreadyDiagnosed,
@@ -1125,9 +1126,8 @@ class AddMissingArguments final
1125
1126
1126
1127
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1127
1128
1128
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1129
- ArrayRef<ConstraintFix *> fixes) const override {
1130
- return diagnose (solutions.front ());
1129
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
1130
+ return diagnose (*commonFixes.front ().first );
1131
1131
}
1132
1132
1133
1133
static AddMissingArguments *create (ConstraintSystem &cs,
@@ -1170,9 +1170,8 @@ class RemoveExtraneousArguments final
1170
1170
1171
1171
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1172
1172
1173
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1174
- ArrayRef<ConstraintFix *> fixes) const override {
1175
- return diagnose (solutions.front ());
1173
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
1174
+ return diagnose (*commonFixes.front ().first );
1176
1175
}
1177
1176
1178
1177
// / FIXME(diagnostics): Once `resolveDeclRefExpr` is gone this
@@ -1381,9 +1380,8 @@ class DefaultGenericArgument final : public ConstraintFix {
1381
1380
1382
1381
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1383
1382
1384
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1385
- ArrayRef<ConstraintFix *> fixes) const override {
1386
- return diagnose (solutions.front ());
1383
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
1384
+ return diagnose (*commonFixes.front ().first );
1387
1385
}
1388
1386
1389
1387
static DefaultGenericArgument *create (ConstraintSystem &cs,
@@ -1457,9 +1455,8 @@ class IgnoreContextualType : public ContextualMismatch {
1457
1455
1458
1456
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1459
1457
1460
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1461
- ArrayRef<ConstraintFix *> fixes) const override {
1462
- return diagnose (solutions.front ());
1458
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
1459
+ return diagnose (*commonFixes.front ().first );
1463
1460
}
1464
1461
1465
1462
static IgnoreContextualType *create (ConstraintSystem &cs, Type resultTy,
0 commit comments