@@ -5201,7 +5201,8 @@ ASTContext::getOpenedArchetypeSignature(Type type, GenericSignature parentSig) {
5201
5201
type = existential->getConstraintType ();
5202
5202
5203
5203
const CanType constraint = type->getCanonicalType ();
5204
- assert (!constraint->hasTypeParameter () && " This only works with archetypes" );
5204
+ assert (parentSig || !constraint->hasTypeParameter () &&
5205
+ " Interface type here requires a parent signature" );
5205
5206
5206
5207
// The opened archetype signature for a protocol type is identical
5207
5208
// to the protocol's own canonical generic signature if there aren't any
@@ -5216,11 +5217,13 @@ ASTContext::getOpenedArchetypeSignature(Type type, GenericSignature parentSig) {
5216
5217
// generic parameters. This ensures that we keep e.g. generic superclass
5217
5218
// existentials contained in a well-formed generic context.
5218
5219
auto canParentSig = parentSig.getCanonicalSignature ();
5219
- auto found = getImpl ().ExistentialSignatures .find ({constraint, canParentSig.getPointer ()});
5220
+ auto key = std::make_pair (constraint, canParentSig.getPointer ());
5221
+ auto found = getImpl ().ExistentialSignatures .find (key);
5220
5222
if (found != getImpl ().ExistentialSignatures .end ())
5221
5223
return found->second ;
5222
5224
5223
- auto genericParam = OpenedArchetypeType::getSelfInterfaceTypeFromContext (canParentSig, type->getASTContext ())
5225
+ auto genericParam = OpenedArchetypeType::getSelfInterfaceTypeFromContext (
5226
+ canParentSig, type->getASTContext ())
5224
5227
->castTo <GenericTypeParamType>();
5225
5228
Requirement requirement (RequirementKind::Conformance, genericParam,
5226
5229
constraint);
0 commit comments