File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -994,3 +994,15 @@ RemoveInvalidCall *RemoveInvalidCall::create(ConstraintSystem &cs,
994
994
ConstraintLocator *locator) {
995
995
return new (cs.getAllocator ()) RemoveInvalidCall (cs, locator);
996
996
}
997
+
998
+ bool AllowInvalidUseOfTrailingClosure::diagnose (Expr *expr, bool asNote) const {
999
+ return false ;
1000
+ }
1001
+
1002
+ AllowInvalidUseOfTrailingClosure *
1003
+ AllowInvalidUseOfTrailingClosure::create (ConstraintSystem &cs, Type argType,
1004
+ Type paramType,
1005
+ ConstraintLocator *locator) {
1006
+ return new (cs.getAllocator ())
1007
+ AllowInvalidUseOfTrailingClosure (cs, argType, paramType, locator);
1008
+ }
Original file line number Diff line number Diff line change @@ -215,6 +215,8 @@ enum class FixKind : uint8_t {
215
215
// / Remove extraneous call to something which can't be invoked e.g.
216
216
// / a variable, a property etc.
217
217
RemoveCall,
218
+
219
+ AllowInvalidUseOfTrailingClosure,
218
220
};
219
221
220
222
class ConstraintFix {
@@ -1488,6 +1490,24 @@ class RemoveInvalidCall final : public ConstraintFix {
1488
1490
ConstraintLocator *locator);
1489
1491
};
1490
1492
1493
+ class AllowInvalidUseOfTrailingClosure final : public AllowArgumentMismatch {
1494
+ AllowInvalidUseOfTrailingClosure (ConstraintSystem &cs, Type argType,
1495
+ Type paramType, ConstraintLocator *locator)
1496
+ : AllowArgumentMismatch(cs, FixKind::AllowInvalidUseOfTrailingClosure,
1497
+ argType, paramType, locator) {}
1498
+
1499
+ public:
1500
+ std::string getName () const {
1501
+ return " allow invalid use of trailing closure" ;
1502
+ }
1503
+
1504
+ bool diagnose (Expr *root, bool asNote = false ) const ;
1505
+
1506
+ static AllowInvalidUseOfTrailingClosure *create (ConstraintSystem &cs,
1507
+ Type argType, Type paramType,
1508
+ ConstraintLocator *locator);
1509
+ };
1510
+
1491
1511
} // end namespace constraints
1492
1512
} // end namespace swift
1493
1513
You can’t perform that action at this time.
0 commit comments