@@ -3072,23 +3072,16 @@ bool ConstraintSystem::repairFailures(
3072
3072
auto elt = path.back ();
3073
3073
switch (elt.getKind ()) {
3074
3074
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 ;
3092
3085
}
3093
3086
3094
3087
LLVM_FALLTHROUGH;
@@ -3521,13 +3514,6 @@ bool ConstraintSystem::repairFailures(
3521
3514
if (rhs->isExistentialType ())
3522
3515
break ;
3523
3516
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
-
3531
3517
if (repairViaOptionalUnwrap (*this , lhs, rhs, matchKind, conversionsOrFixes,
3532
3518
locator))
3533
3519
break ;
0 commit comments