Sema: Remove 'inferred result type requires explicit coercion' diagnostic

This commit is contained in:
Slava Pestov
2023-11-16 11:24:19 -05:00
parent ef6630f0ac
commit 1b1963e904
8 changed files with 16 additions and 404 deletions

View File

@@ -13015,19 +13015,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyApplicableFnConstraint(
result2, opened.second->getExistentialType(), opened.first,
TypePosition::Covariant);
}
// If result type has any erased existential types it requires explicit
// `as` coercion.
if (AddExplicitExistentialCoercion::isRequired(
*this, func2->getResult(), openedExistentials, locator)) {
if (!shouldAttemptFixes())
return SolutionKind::Error;
if (recordFix(AddExplicitExistentialCoercion::create(
*this, result2, getConstraintLocator(locator))))
return SolutionKind::Error;
}
}
// The result types are equivalent.