Skip to content

Commit cc0e621

Browse files
committed
[CSFix] NFC: Remove obsolete IgnoreKeyPathContextualMismatch fix
1 parent 6fd6c16 commit cc0e621

File tree

3 files changed

+0
-42
lines changed

3 files changed

+0
-42
lines changed

include/swift/Sema/CSFix.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -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.:

lib/Sema/CSFix.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,13 +1296,6 @@ AllowInvalidRefInKeyPath::create(ConstraintSystem &cs, RefKind kind,
12961296
AllowInvalidRefInKeyPath(cs, kind, member, locator);
12971297
}
12981298

1299-
KeyPathContextualMismatch *
1300-
KeyPathContextualMismatch::create(ConstraintSystem &cs, Type lhs, Type rhs,
1301-
ConstraintLocator *locator) {
1302-
return new (cs.getAllocator())
1303-
KeyPathContextualMismatch(cs, lhs, rhs, locator);
1304-
}
1305-
13061299
bool RemoveAddressOf::diagnose(const Solution &solution, bool asNote) const {
13071300
InvalidUseOfAddressOf failure(solution, getFromType(), getToType(),
13081301
getLocator());

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15055,7 +15055,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1505515055
case FixKind::RemoveExtraneousArguments:
1505615056
case FixKind::SpecifyTypeForPlaceholder:
1505715057
case FixKind::AllowAutoClosurePointerConversion:
15058-
case FixKind::IgnoreKeyPathContextualMismatch:
1505915058
case FixKind::NotCompileTimeConst:
1506015059
case FixKind::RenameConflictingPatternVariables:
1506115060
case FixKind::MustBeCopyable:

0 commit comments

Comments
 (0)