mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Remove 'inferred result type requires explicit coercion' diagnostic
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user