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 {
168
168
169
169
// / Query whether any replacement types in the map contain an opened
170
170
// / existential.
171
- bool hasOpenedExistential () const ;
171
+ bool hasLocalArchetypes () const ;
172
172
173
173
// / Query whether any replacement types in the map contain dynamic Self.
174
174
bool hasDynamicSelf () const ;
Original file line number Diff line number Diff line change @@ -192,15 +192,12 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
192
192
// If we have local archetypes to substitute, check whether that's
193
193
// relevant to this particular substitution.
194
194
if (!LocalArchetypeSubs.empty ()) {
195
- for ( auto ty : Subs.getReplacementTypes ()) {
195
+ if ( Subs.hasLocalArchetypes ()) {
196
196
// If we found a type containing a local archetype, substitute
197
197
// 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 ());
204
201
}
205
202
}
206
203
Original file line number Diff line number Diff line change @@ -132,9 +132,9 @@ bool SubstitutionMap::hasArchetypes() const {
132
132
return false ;
133
133
}
134
134
135
- bool SubstitutionMap::hasOpenedExistential () const {
135
+ bool SubstitutionMap::hasLocalArchetypes () const {
136
136
for (Type replacementTy : getReplacementTypesBuffer ()) {
137
- if (replacementTy && replacementTy->hasOpenedExistential ())
137
+ if (replacementTy && replacementTy->hasLocalArchetype ())
138
138
return true ;
139
139
}
140
140
return false ;
You can’t perform that action at this time.
0 commit comments