@@ -315,7 +315,8 @@ class Callee {
315
315
CanFunctionType SubstFormalInterfaceType;
316
316
317
317
// / The substitutions applied to OrigFormalInterfaceType to produce
318
- // / SubstFormalInterfaceType.
318
+ // / SubstFormalInterfaceType, substituted into the current type expansion
319
+ // / context.
319
320
SubstitutionMap Substitutions;
320
321
321
322
// / The list of values captured by our callee.
@@ -351,14 +352,14 @@ class Callee {
351
352
// / Constructor for Callee::forDirect.
352
353
Callee (SILGenFunction &SGF, SILDeclRef standaloneFunction,
353
354
AbstractionPattern origFormalType, CanAnyFunctionType substFormalType,
354
- SubstitutionMap subs, SILLocation l,
355
+ SubstitutionMap subs, SubstitutionMap formalSubs, SILLocation l,
355
356
bool callDynamicallyReplaceableImpl = false )
356
357
: kind(callDynamicallyReplaceableImpl
357
358
? Kind::StandaloneFunctionDynamicallyReplaceableImpl
358
359
: Kind::StandaloneFunction),
359
360
Constant(standaloneFunction), OrigFormalInterfaceType(origFormalType),
360
361
SubstFormalInterfaceType(
361
- getSubstFormalInterfaceType (substFormalType, subs )),
362
+ getSubstFormalInterfaceType (substFormalType, formalSubs )),
362
363
Substitutions(subs), Loc(l) {}
363
364
364
365
// / Constructor called by all for* factory methods except forDirect and
@@ -387,7 +388,9 @@ class Callee {
387
388
auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
388
389
return Callee (
389
390
SGF, c, ci.FormalPattern , ci.FormalType ,
390
- subs.mapIntoTypeExpansionContext (SGF.getTypeExpansionContext ()), l,
391
+ subs.mapIntoTypeExpansionContext (SGF.getTypeExpansionContext ()),
392
+ subs,
393
+ l,
391
394
callPreviousDynamicReplaceableImpl);
392
395
}
393
396
0 commit comments