Skip to content

Commit f61d8c5

Browse files
committed
SILGen: Simplify getSubstitutionsForPropertyInitializer()
1 parent 4f42c55 commit f61d8c5

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

lib/SILGen/SILGenConstructor.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,7 @@ static SubstitutionMap getSubstitutionsForPropertyInitializer(
284284
// replacement types are the archetypes of the initializer itself.
285285
return SubstitutionMap::get(
286286
nominal->getGenericSignatureOfContext(),
287-
[&](SubstitutableType *type) -> Type {
288-
if (auto gp = type->getAs<GenericTypeParamType>()) {
289-
auto archetype = genericEnv->mapTypeIntoContext(gp);
290-
if (!gp->isParameterPack())
291-
return archetype;
292-
293-
return PackType::getSingletonPackExpansion(archetype);
294-
}
295-
296-
return Type(type);
297-
},
287+
QuerySubstitutionMap{genericEnv->getForwardingSubstitutionMap()},
298288
LookUpConformanceInModule(dc->getParentModule()));
299289
}
300290

0 commit comments

Comments
 (0)