mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #78377 from hamishknight/no-simplify-result
[CS] Don't simplify `FunctionResult` in `simplifyLocator`
This commit is contained in:
@@ -5180,11 +5180,16 @@ bool ConstraintSystem::repairFailures(
|
||||
// side isn't, let's check it would be possible to fix
|
||||
// this by forming an explicit call.
|
||||
auto convertTo = dstType->lookThroughAllOptionalTypes();
|
||||
// Right-hand side can't be - a function, a type variable or dependent
|
||||
// member, or `Any` (if function conversion to `Any` didn't succeed there
|
||||
// is something else going on e.g. problem with escapiness).
|
||||
if (convertTo->is<FunctionType>() || convertTo->isTypeVariableOrMember() ||
|
||||
convertTo->isAny())
|
||||
|
||||
// If the RHS is a function type, the source must be a function-returning
|
||||
// function.
|
||||
if (convertTo->is<FunctionType>() && !resultType->is<FunctionType>())
|
||||
return false;
|
||||
|
||||
// Right-hand side can't be a type variable or dependent member, or `Any`
|
||||
// (if function conversion to `Any` didn't succeed there is something else
|
||||
// going on e.g. problem with escapiness).
|
||||
if (convertTo->isTypeVariableOrMember() || convertTo->isAny())
|
||||
return false;
|
||||
|
||||
ConstraintKind matchKind;
|
||||
@@ -15243,12 +15248,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
|
||||
return result;
|
||||
}
|
||||
|
||||
case FixKind::AutoClosureForwarding: {
|
||||
if (recordFix(fix))
|
||||
return SolutionKind::Error;
|
||||
return matchTypes(type1, type2, matchKind, subflags, locator);
|
||||
}
|
||||
|
||||
case FixKind::AllowTupleTypeMismatch: {
|
||||
if (fix->getAs<AllowTupleTypeMismatch>()->isElementMismatch()) {
|
||||
auto *locator = fix->getLocator();
|
||||
|
||||
Reference in New Issue
Block a user