mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #84501 from slavapestov/fix-rdar160389221
Sema: Workaround for broken existential opening behavior
This commit is contained in:
@@ -13394,8 +13394,12 @@ retry_after_fail:
|
||||
choiceType = objectType;
|
||||
}
|
||||
|
||||
// FIXME: The !getSelfProtocolDecl() check is load-bearing, because
|
||||
// this optimization interacts poorly with existential opening
|
||||
// somehow. It should all be removed.
|
||||
if (auto *choiceFnType = choiceType->getAs<FunctionType>()) {
|
||||
if (isa<ConstructorDecl>(choice.getDecl())) {
|
||||
if (isa<ConstructorDecl>(choice.getDecl()) &&
|
||||
!choice.getDecl()->getDeclContext()->getSelfProtocolDecl()) {
|
||||
auto choiceResultType = choice.getBaseType()
|
||||
->getRValueType()
|
||||
->getMetatypeInstanceType();
|
||||
|
||||
Reference in New Issue
Block a user