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 @@ -4551,12 +4551,18 @@ CanGenericSignature ASTContext::getSingleGenericParameterSignature() const {
45514551// constraints while existential values do.
45524552CanGenericSignature ASTContext::getOpenedArchetypeSignature (CanType existential,
45534553 ModuleDecl *mod) {
4554+ assert (existential.isExistentialType ());
4555+
4556+ // The opened archetype signature for a protocol type is identical
4557+ // to the protocol's own canonical generic signature.
4558+ if (const auto protoTy = dyn_cast<ProtocolType>(existential)) {
4559+ return protoTy->getDecl ()->getGenericSignature ()->getCanonicalSignature ();
4560+ }
4561+
45544562 auto found = getImpl ().ExistentialSignatures .find (existential);
45554563 if (found != getImpl ().ExistentialSignatures .end ())
45564564 return found->second ;
45574565
4558- assert (existential.isExistentialType ());
4559-
45604566 auto genericParam = GenericTypeParamType::get (0 , 0 , *this );
45614567 Requirement requirement (RequirementKind::Conformance, genericParam,
45624568 existential);
You can’t perform that action at this time.
0 commit comments