Skip to content

Commit 5572832

Browse files
[CSSimplify] Remove diagnostics obsolete diagnostics checks involving CSDiag logic
1 parent b826b3c commit 5572832

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,23 +3072,16 @@ bool ConstraintSystem::repairFailures(
30723072
auto elt = path.back();
30733073
switch (elt.getKind()) {
30743074
case ConstraintLocator::LValueConversion: {
3075-
auto CTP = getContextualTypePurpose(anchor);
3076-
// Special case for `CTP_CallArgument` set by CSDiag
3077-
// while type-checking each argument because we yet
3078-
// to cover argument-to-parameter conversions in the
3079-
// new framework.
3080-
if (CTP != CTP_CallArgument) {
3081-
// Ignore l-value conversion element since it has already
3082-
// played its role.
3083-
path.pop_back();
3084-
// If this is a contextual mismatch between l-value types e.g.
3085-
// `@lvalue String vs. @lvalue Int`, let's pretend that it's okay.
3086-
if (!path.empty() && path.back().is<LocatorPathElt::ContextualType>()) {
3087-
auto *locator = getConstraintLocator(anchor, path.back());
3088-
conversionsOrFixes.push_back(
3089-
IgnoreContextualType::create(*this, lhs, rhs, locator));
3090-
break;
3091-
}
3075+
// Ignore l-value conversion element since it has already
3076+
// played its role.
3077+
path.pop_back();
3078+
// If this is a contextual mismatch between l-value types e.g.
3079+
// `@lvalue String vs. @lvalue Int`, let's pretend that it's okay.
3080+
if (!path.empty() && path.back().is<LocatorPathElt::ContextualType>()) {
3081+
auto *locator = getConstraintLocator(anchor, path.back());
3082+
conversionsOrFixes.push_back(
3083+
IgnoreContextualType::create(*this, lhs, rhs, locator));
3084+
break;
30923085
}
30933086

30943087
LLVM_FALLTHROUGH;
@@ -3521,13 +3514,6 @@ bool ConstraintSystem::repairFailures(
35213514
if (rhs->isExistentialType())
35223515
break;
35233516

3524-
// TODO(diagnostics): This is a problem related to `inout` mismatch,
3525-
// in argument position, and we got here from CSDiag. Once
3526-
// argument-to-pararameter conversion failures are implemented,
3527-
// this check could be removed.
3528-
if (lhs->is<InOutType>() || rhs->is<InOutType>())
3529-
break;
3530-
35313517
if (repairViaOptionalUnwrap(*this, lhs, rhs, matchKind, conversionsOrFixes,
35323518
locator))
35333519
break;

0 commit comments

Comments
 (0)