mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #38235 from xedin/rdar-79757320
[Diagnostics] Ignore result type failures if one side is a hole
This commit is contained in:
@@ -4286,8 +4286,7 @@ bool ConstraintSystem::repairFailures(
|
||||
// it's going to be diagnosed by specialized fix which deals
|
||||
// with generic argument mismatches.
|
||||
if (matchKind == ConstraintKind::BindToPointerType) {
|
||||
auto *member = rhs->getAs<DependentMemberType>();
|
||||
if (!(member && member->getBase()->hasPlaceholder()))
|
||||
if (!rhs->isPlaceholder())
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4634,6 +4633,12 @@ bool ConstraintSystem::repairFailures(
|
||||
}
|
||||
|
||||
case ConstraintLocator::FunctionResult: {
|
||||
if (lhs->isPlaceholder() || rhs->isPlaceholder()) {
|
||||
recordAnyTypeVarAsPotentialHole(lhs);
|
||||
recordAnyTypeVarAsPotentialHole(rhs);
|
||||
return true;
|
||||
}
|
||||
|
||||
auto *loc = getConstraintLocator(anchor, {path.begin(), path.end() - 1});
|
||||
// If this is a mismatch between contextual type and (trailing)
|
||||
// closure with explicitly specified result type let's record it
|
||||
@@ -4654,6 +4659,7 @@ bool ConstraintSystem::repairFailures(
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle function result coerce expression wrong type conversion.
|
||||
if (isExpr<CoerceExpr>(anchor)) {
|
||||
auto *fix =
|
||||
|
||||
Reference in New Issue
Block a user