@@ -291,7 +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) const { return false ; }
294
+ virtual bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
295
+ ArrayRef<ConstraintFix *> fixes) const {
296
+ return false ;
297
+ }
295
298
296
299
void print (llvm::raw_ostream &Out) const ;
297
300
@@ -847,11 +850,16 @@ class DefineMemberBasedOnUse final : public ConstraintFix {
847
850
848
851
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
849
852
850
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions) const override ;
853
+ bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
854
+ ArrayRef<ConstraintFix *> fixes) const override ;
851
855
852
856
static DefineMemberBasedOnUse *create (ConstraintSystem &cs, Type baseType,
853
857
DeclNameRef member, bool alreadyDiagnosed,
854
858
ConstraintLocator *locator);
859
+
860
+ static bool classof (const ConstraintFix *fix) {
861
+ return fix->getKind () == FixKind::DefineMemberBasedOnUse;
862
+ }
855
863
};
856
864
857
865
class AllowInvalidMemberRef : public ConstraintFix {
@@ -1117,7 +1125,8 @@ class AddMissingArguments final
1117
1125
1118
1126
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1119
1127
1120
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions) const override {
1128
+ bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1129
+ ArrayRef<ConstraintFix *> fixes) const override {
1121
1130
return diagnose (solutions.front ());
1122
1131
}
1123
1132
@@ -1161,7 +1170,8 @@ class RemoveExtraneousArguments final
1161
1170
1162
1171
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1163
1172
1164
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions) const override {
1173
+ bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1174
+ ArrayRef<ConstraintFix *> fixes) const override {
1165
1175
return diagnose (solutions.front ());
1166
1176
}
1167
1177
@@ -1371,7 +1381,8 @@ class DefaultGenericArgument final : public ConstraintFix {
1371
1381
1372
1382
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1373
1383
1374
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions) const override {
1384
+ bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1385
+ ArrayRef<ConstraintFix *> fixes) const override {
1375
1386
return diagnose (solutions.front ());
1376
1387
}
1377
1388
@@ -1446,7 +1457,8 @@ class IgnoreContextualType : public ContextualMismatch {
1446
1457
1447
1458
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1448
1459
1449
- bool diagnoseForAmbiguity (ArrayRef<Solution> solutions) const override {
1460
+ bool diagnoseForAmbiguity (ArrayRef<Solution> solutions,
1461
+ ArrayRef<ConstraintFix *> fixes) const override {
1450
1462
return diagnose (solutions.front ());
1451
1463
}
1452
1464
0 commit comments