mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ConstraintSystem] Don't produce argument mismatch fix when pointer conversions are involved
This commit is contained in:
@@ -2583,6 +2583,16 @@ bool ConstraintSystem::repairFailures(
|
||||
if (hasConversionOrRestriction(ConversionRestrictionKind::DeepEquality))
|
||||
break;
|
||||
|
||||
// If there implicit 'something-to-pointer' conversions involved,
|
||||
// such conversions are going to be diagnosed by specialized fix
|
||||
// which deals with generic argument mismatches.
|
||||
if (hasConversionOrRestriction(ConversionRestrictionKind::ArrayToPointer) ||
|
||||
hasConversionOrRestriction(ConversionRestrictionKind::InoutToPointer) ||
|
||||
hasConversionOrRestriction(
|
||||
ConversionRestrictionKind::PointerToPointer) ||
|
||||
matchKind == ConstraintKind::BindToPointerType)
|
||||
break;
|
||||
|
||||
// If this is a ~= operator implicitly generated by pattern matching
|
||||
// let's not try to fix right-hand side of the operator because it's
|
||||
// a correct contextual type.
|
||||
|
||||
Reference in New Issue
Block a user