@@ -393,10 +393,6 @@ enum class FixKind : uint8_t {
393393 // / is marked as `inout`.
394394 AllowConversionThroughInOut,
395395
396- // / Ignore either capability (read/write) or type mismatch in conversion
397- // / between two key path types.
398- IgnoreKeyPathContextualMismatch,
399-
400396 // / Ignore a type mismatch between deduced element type and externally
401397 // / imposed one.
402398 IgnoreCollectionElementContextualMismatch,
@@ -1167,36 +1163,6 @@ class GenericArgumentsMismatch final
11671163 }
11681164};
11691165
1170- // / Detect situations where key path doesn't have capability required
1171- // / by the context e.g. read-only vs. writable, or either root or value
1172- // / types are incorrect e.g.
1173- // /
1174- // / ```swift
1175- // / struct S { let foo: Int }
1176- // / let _: WritableKeyPath<S, Int> = \.foo
1177- // / ```
1178- // /
1179- // / Here context requires a writable key path but `foo` property is
1180- // / read-only.
1181- class KeyPathContextualMismatch final : public ContextualMismatch {
1182- KeyPathContextualMismatch (ConstraintSystem &cs, Type lhs, Type rhs,
1183- ConstraintLocator *locator)
1184- : ContextualMismatch(cs, FixKind::IgnoreKeyPathContextualMismatch, lhs,
1185- rhs, locator) {}
1186-
1187- public:
1188- std::string getName () const override {
1189- return " fix key path contextual mismatch" ;
1190- }
1191-
1192- static KeyPathContextualMismatch *
1193- create (ConstraintSystem &cs, Type lhs, Type rhs, ConstraintLocator *locator);
1194-
1195- static bool classof (const ConstraintFix *fix) {
1196- return fix->getKind () == FixKind::IgnoreKeyPathContextualMismatch;
1197- }
1198- };
1199-
12001166// / Detect situations when argument of the @autoclosure parameter is itself
12011167// / marked as @autoclosure and is not applied. Form a fix which suggests a
12021168// / proper way to forward such arguments, e.g.:
0 commit comments