Merge pull request #69950 from slavapestov/clean-up-open-existentials

Cleanups and fixes for opened existentials
This commit is contained in:
Slava Pestov
2023-11-28 10:45:19 -05:00
committed by GitHub
15 changed files with 285 additions and 684 deletions

View File

@@ -13014,19 +13014,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.