File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -226,21 +226,12 @@ class TypeSubstCloner : public SILClonerWithScopes<ImplClass> {
226
226
227
227
ProtocolConformanceRef remapConformance (Type ty,
228
228
ProtocolConformanceRef conf) {
229
- // If we have local archetypes to substitute, do so now.
230
- if (ty->hasLocalArchetype () && !LocalArchetypeSubs.empty ()) {
231
- conf =
232
- conf.subst (ty,
233
- QueryTypeSubstitutionMapOrIdentity{LocalArchetypeSubs},
234
- MakeAbstractConformanceForGenericType ());
235
- ty = ty.subst (
236
- QueryTypeSubstitutionMapOrIdentity{LocalArchetypeSubs},
237
- MakeAbstractConformanceForGenericType ());
238
- }
229
+ SubstitutionMapWithLocalArchetypes functor (SubsMap, LocalArchetypeSubs);
230
+ auto substTy = ty.subst (functor, functor)->getCanonicalType ();
231
+ auto substConf = conf.subst (ty, functor, functor);
239
232
240
233
auto context = getBuilder ().getTypeExpansionContext ();
241
234
242
- auto substTy = ty.subst (SubsMap)->getCanonicalType ();
243
- auto substConf = conf.subst (ty, SubsMap);
244
235
if (!substTy->hasOpaqueArchetype () ||
245
236
!context.shouldLookThroughOpaqueTypeArchetypes ())
246
237
return substConf;
You can’t perform that action at this time.
0 commit comments