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 {
4551
4551
// constraints while existential values do.
4552
4552
CanGenericSignature ASTContext::getOpenedArchetypeSignature (CanType existential,
4553
4553
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
+
4554
4562
auto found = getImpl ().ExistentialSignatures .find (existential);
4555
4563
if (found != getImpl ().ExistentialSignatures .end ())
4556
4564
return found->second ;
4557
4565
4558
- assert (existential.isExistentialType ());
4559
-
4560
4566
auto genericParam = GenericTypeParamType::get (0 , 0 , *this );
4561
4567
Requirement requirement (RequirementKind::Conformance, genericParam,
4562
4568
existential);
You can’t perform that action at this time.
0 commit comments