File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ LocalArchetypeRequirementCollector::LocalArchetypeRequirementCollector(
29
29
: Context(ctx), OuterSig(sig), Depth(sig.getNextDepth()) {}
30
30
31
31
void LocalArchetypeRequirementCollector::addOpenedExistential (Type constraint) {
32
+ if (auto existential = constraint->getAs <ExistentialType>())
33
+ constraint = existential->getConstraintType ();
34
+
32
35
assert (constraint->isConstraintType () ||
33
36
constraint->getClassOrBoundGenericClass ());
34
37
assert (OuterSig || !constraint->hasTypeParameter () &&
@@ -134,10 +137,9 @@ GenericSignature swift::buildGenericSignatureWithCapturedEnvironments(
134
137
break ;
135
138
136
139
case GenericEnvironment::Kind::OpenedExistential: {
137
- auto constraint = genericEnv->getOpenedExistentialType ();
138
- if (auto existential = constraint->getAs <ExistentialType>())
139
- constraint = existential->getConstraintType ()->mapTypeOutOfContext ();
140
- collector.addOpenedExistential (constraint);
140
+ auto existentialTy = genericEnv->getOpenedExistentialType ()
141
+ ->mapTypeOutOfContext ();
142
+ collector.addOpenedExistential (existentialTy);
141
143
continue ;
142
144
}
143
145
case GenericEnvironment::Kind::OpenedElement: {
You can’t perform that action at this time.
0 commit comments