diff --git a/lib/SILGen/SILGenConstructor.cpp b/lib/SILGen/SILGenConstructor.cpp index f8b5db59d46..9e8140bf7f0 100644 --- a/lib/SILGen/SILGenConstructor.cpp +++ b/lib/SILGen/SILGenConstructor.cpp @@ -568,17 +568,7 @@ void SILGenFunction::emitClassConstructorAllocator(ConstructorDecl *ctor) { SILType initTy; // Call the initializer. - SubstitutionMap subMap; - if (auto *genericEnv = ctor->getGenericEnvironmentOfContext()) { - auto *genericSig = genericEnv->getGenericSignature(); - subMap = SubstitutionMap::get( - genericSig, - [&](SubstitutableType *t) -> Type { - return genericEnv->mapTypeIntoContext( - t->castTo()); - }, - MakeAbstractConformanceForGenericType()); - } + auto subMap = F.getForwardingSubstitutionMap(); std::tie(initVal, initTy) = emitSiblingMethodRef(Loc, selfValue, initConstant, subMap);