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