File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -589,7 +589,11 @@ Type ASTBuilder::createProtocolCompositionType(
589
589
members.push_back (protocol->getDeclaredInterfaceType ());
590
590
if (superclass && superclass->getClassOrBoundGenericClass ())
591
591
members.push_back (superclass);
592
- return ProtocolCompositionType::get (Ctx, members, isClassBound);
592
+ Type composition = ProtocolCompositionType::get (Ctx, members, isClassBound);
593
+ if (Ctx.LangOpts .EnableExplicitExistentialTypes ) {
594
+ composition = ExistentialType::get (composition);
595
+ }
596
+ return composition;
593
597
}
594
598
595
599
static MetatypeRepresentation
@@ -607,6 +611,8 @@ getMetatypeRepresentation(ImplMetatypeRepresentation repr) {
607
611
608
612
Type ASTBuilder::createExistentialMetatypeType (Type instance,
609
613
Optional<Demangle::ImplMetatypeRepresentation> repr) {
614
+ if (auto existential = instance->getAs <ExistentialType>())
615
+ instance = existential->getConstraintType ();
610
616
if (!instance->isAnyExistentialType ())
611
617
return Type ();
612
618
if (!repr)
You can’t perform that action at this time.
0 commit comments