Skip to content

Commit f7b0cbc

Browse files
authored
Merge pull request #29531 from xedin/diag-all-metatype-mismatches
[ConstraintSystem] Extend metatype instance type mismatch coverage
2 parents 5b8ba88 + 3fff5dd commit f7b0cbc

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4068,16 +4068,12 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
40684068
auto result =
40694069
matchTypes(instanceType1, instanceType2, subKind, subflags,
40704070
locator.withPathElement(ConstraintLocator::InstanceType));
4071-
if (shouldAttemptFixes() && result.isFailure()) {
4072-
auto *anchor = locator.getAnchor();
4073-
if (anchor && isa<CoerceExpr>(anchor)) {
4074-
auto *fix =
4075-
ContextualMismatch::create(*this, instanceType1, instanceType2,
4076-
getConstraintLocator(locator));
4077-
conversionsOrFixes.push_back(fix);
4078-
break;
4079-
}
4080-
}
4071+
4072+
// If matching of the instance types resulted in the failure make sure
4073+
// to give `repairFailure` a chance to run to attempt to fix the issue.
4074+
if (shouldAttemptFixes() && result.isFailure())
4075+
break;
4076+
40814077
return result;
40824078
}
40834079

0 commit comments

Comments
 (0)