File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ class SubstitutionMap {
168168
169169 // / Query whether any replacement types in the map contain an opened
170170 // / existential.
171- bool hasOpenedExistential () const ;
171+ bool hasLocalArchetypes () const ;
172172
173173 // / Query whether any replacement types in the map contain dynamic Self.
174174 bool hasDynamicSelf () const ;
Original file line number Diff line number Diff line change @@ -192,15 +192,12 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
192192 // If we have local archetypes to substitute, check whether that's
193193 // relevant to this particular substitution.
194194 if (!LocalArchetypeSubs.empty ()) {
195- for ( auto ty : Subs.getReplacementTypes ()) {
195+ if ( Subs.hasLocalArchetypes ()) {
196196 // If we found a type containing a local archetype, substitute
197197 // open existentials throughout the substitution map.
198- if (ty->hasLocalArchetype ()) {
199- Subs = Subs.subst (QueryTypeSubstitutionMapOrIdentity{
200- LocalArchetypeSubs},
201- MakeAbstractConformanceForGenericType ());
202- break ;
203- }
198+ Subs = Subs.subst (QueryTypeSubstitutionMapOrIdentity{
199+ LocalArchetypeSubs},
200+ MakeAbstractConformanceForGenericType ());
204201 }
205202 }
206203
Original file line number Diff line number Diff line change @@ -132,9 +132,9 @@ bool SubstitutionMap::hasArchetypes() const {
132132 return false ;
133133}
134134
135- bool SubstitutionMap::hasOpenedExistential () const {
135+ bool SubstitutionMap::hasLocalArchetypes () const {
136136 for (Type replacementTy : getReplacementTypesBuffer ()) {
137- if (replacementTy && replacementTy->hasOpenedExistential ())
137+ if (replacementTy && replacementTy->hasLocalArchetype ())
138138 return true ;
139139 }
140140 return false ;
You can’t perform that action at this time.
0 commit comments