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(
2929    : Context(ctx), OuterSig(sig), Depth(sig.getNextDepth()) {}
3030
3131void  LocalArchetypeRequirementCollector::addOpenedExistential (Type constraint) {
32+   if  (auto  existential = constraint->getAs <ExistentialType>())
33+     constraint = existential->getConstraintType ();
34+ 
3235  assert (constraint->isConstraintType () ||
3336         constraint->getClassOrBoundGenericClass ());
3437  assert (OuterSig || !constraint->hasTypeParameter () &&
@@ -134,10 +137,9 @@ GenericSignature swift::buildGenericSignatureWithCapturedEnvironments(
134137      break ;
135138
136139    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);
141143      continue ;
142144    }
143145    case  GenericEnvironment::Kind::OpenedElement: {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments