@@ -361,6 +361,10 @@ enum class FixKind : uint8_t {
361
361
// / Allow argument-to-parameter subtyping even when parameter type
362
362
// / is marked as `inout`.
363
363
AllowConversionThroughInOut,
364
+
365
+ // / Ignore either capability (read/write) or type mismatch in conversion
366
+ // / between two key path types.
367
+ IgnoreKeyPathContextualMismatch,
364
368
};
365
369
366
370
class ConstraintFix {
@@ -958,7 +962,8 @@ class GenericArgumentsMismatch final
958
962
class KeyPathContextualMismatch final : public ContextualMismatch {
959
963
KeyPathContextualMismatch (ConstraintSystem &cs, Type lhs, Type rhs,
960
964
ConstraintLocator *locator)
961
- : ContextualMismatch(cs, lhs, rhs, locator) {}
965
+ : ContextualMismatch(cs, FixKind::IgnoreKeyPathContextualMismatch, lhs,
966
+ rhs, locator) {}
962
967
963
968
public:
964
969
std::string getName () const override {
@@ -967,6 +972,10 @@ class KeyPathContextualMismatch final : public ContextualMismatch {
967
972
968
973
static KeyPathContextualMismatch *
969
974
create (ConstraintSystem &cs, Type lhs, Type rhs, ConstraintLocator *locator);
975
+
976
+ static bool classof (ConstraintFix *fix) {
977
+ return fix->getKind () == FixKind::IgnoreKeyPathContextualMismatch;
978
+ }
970
979
};
971
980
972
981
// / Detect situations when argument of the @autoclosure parameter is itself
0 commit comments