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