Skip to content

Commit c946b38

Browse files
committed
[ConstraintSystem] Don't produce argument mismatch fix when pointer conversions are involved
1 parent 93b39c9 commit c946b38

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2583,6 +2583,16 @@ bool ConstraintSystem::repairFailures(
25832583
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality))
25842584
break;
25852585

2586+
// If there implicit 'something-to-pointer' conversions involved,
2587+
// such conversions are going to be diagnosed by specialized fix
2588+
// which deals with generic argument mismatches.
2589+
if (hasConversionOrRestriction(ConversionRestrictionKind::ArrayToPointer) ||
2590+
hasConversionOrRestriction(ConversionRestrictionKind::InoutToPointer) ||
2591+
hasConversionOrRestriction(
2592+
ConversionRestrictionKind::PointerToPointer) ||
2593+
matchKind == ConstraintKind::BindToPointerType)
2594+
break;
2595+
25862596
// If this is a ~= operator implicitly generated by pattern matching
25872597
// let's not try to fix right-hand side of the operator because it's
25882598
// a correct contextual type.

0 commit comments

Comments
 (0)