mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Record generic fix if destination of a pointer conversion is invalid
If the right-hand side (destination) of value-to-pointer conversion is incorrect e.g. base type of member is a hole, let's record a generic "invalid conversion" failure. Resolves: rdar://problem/68254165
This commit is contained in:
@@ -3829,8 +3829,11 @@ bool ConstraintSystem::repairFailures(
|
||||
// If this is an implicit 'something-to-pointer' conversion
|
||||
// it's going to be diagnosed by specialized fix which deals
|
||||
// with generic argument mismatches.
|
||||
if (matchKind == ConstraintKind::BindToPointerType)
|
||||
break;
|
||||
if (matchKind == ConstraintKind::BindToPointerType) {
|
||||
auto *member = rhs->getAs<DependentMemberType>();
|
||||
if (!(member && member->getBase()->hasHole()))
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user