File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2842,8 +2842,8 @@ bool ConstraintSystem::repairFailures(
2842
2842
2843
2843
// If it has a deep equality restriction, defer the diagnostic to
2844
2844
// GenericMismatch.
2845
- if (hasConversionOrRestriction (ConversionRestrictionKind::DeepEquality)) {
2846
- if ( !lhs->getOptionalObjectType () && !rhs->getOptionalObjectType ())
2845
+ if (hasConversionOrRestriction (ConversionRestrictionKind::DeepEquality) &&
2846
+ !lhs->getOptionalObjectType () && !rhs->getOptionalObjectType ()) {
2847
2847
return false ;
2848
2848
}
2849
2849
@@ -3503,6 +3503,13 @@ bool ConstraintSystem::repairFailures(
3503
3503
break ;
3504
3504
}
3505
3505
}
3506
+ // Handle function result coerce expression wrong type conversion.
3507
+ if (isa<CoerceExpr>(anchor)) {
3508
+ auto *fix =
3509
+ ContextualMismatch::create (*this , lhs, rhs, loc);
3510
+ conversionsOrFixes.push_back (fix);
3511
+ break ;
3512
+ }
3506
3513
LLVM_FALLTHROUGH;
3507
3514
}
3508
3515
You can’t perform that action at this time.
0 commit comments