@@ -347,6 +347,10 @@ enum class FixKind : uint8_t {
347
347
// / Fix conversion from async to sync function by removing explicit
348
348
// / `async` attribute from the source function.
349
349
DropAsyncAttribute,
350
+
351
+ // / Allow invalid pointer conversions for autoclosure result types as if the
352
+ // / pointer type is a function parameter rather than an autoclosure result.
353
+ AllowAutoClosurePointerConversion,
350
354
};
351
355
352
356
class ConstraintFix {
@@ -982,12 +986,12 @@ class AutoClosureForwarding final : public ConstraintFix {
982
986
}
983
987
};
984
988
985
- // / Allow invalid pointer conversions for autoclosure result types as if the
986
- // / pointer type is a function parameter rather than an autoclosure result.
987
989
class AllowAutoClosurePointerConversion final : public ContextualMismatch {
988
990
AllowAutoClosurePointerConversion (ConstraintSystem &cs, Type pointeeType,
989
- Type pointerType, ConstraintLocator *locator)
990
- : ContextualMismatch(cs, pointeeType, pointerType, locator) {}
991
+ Type pointerType,
992
+ ConstraintLocator *locator)
993
+ : ContextualMismatch(cs, FixKind::AllowAutoClosurePointerConversion,
994
+ pointeeType, pointerType, locator) {}
991
995
992
996
public:
993
997
std::string getName () const override {
@@ -1000,6 +1004,10 @@ class AllowAutoClosurePointerConversion final : public ContextualMismatch {
1000
1004
Type pointeeType,
1001
1005
Type pointerType,
1002
1006
ConstraintLocator *locator);
1007
+
1008
+ static bool classof (ConstraintFix *fix) {
1009
+ return fix->getKind () == FixKind::AllowAutoClosurePointerConversion;
1010
+ }
1003
1011
};
1004
1012
1005
1013
class RemoveUnwrap final : public ConstraintFix {
0 commit comments