File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4556,12 +4556,18 @@ CanGenericSignature ASTContext::getSingleGenericParameterSignature() const {
45564556// constraints while existential values do.
45574557CanGenericSignature ASTContext::getOpenedArchetypeSignature (CanType existential,
45584558 ModuleDecl *mod) {
4559+ assert (existential.isExistentialType ());
4560+
4561+ // The opened archetype signature for a protocol type is identical
4562+ // to the protocol's own canonical generic signature.
4563+ if (const auto protoTy = dyn_cast<ProtocolType>(existential)) {
4564+ return protoTy->getDecl ()->getGenericSignature ()->getCanonicalSignature ();
4565+ }
4566+
45594567 auto found = getImpl ().ExistentialSignatures .find (existential);
45604568 if (found != getImpl ().ExistentialSignatures .end ())
45614569 return found->second ;
45624570
4563- assert (existential.isExistentialType ());
4564-
45654571 auto genericParam = GenericTypeParamType::get (0 , 0 , *this );
45664572 Requirement requirement (RequirementKind::Conformance, genericParam,
45674573 existential);
You can’t perform that action at this time.
0 commit comments