@@ -452,7 +452,7 @@ class Callee {
452
452
auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
453
453
return Callee (
454
454
SGF, c, ci.FormalPattern , ci.FormalType ,
455
- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()),
455
+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()),
456
456
subs,
457
457
l,
458
458
callPreviousDynamicReplaceableImpl);
@@ -465,15 +465,15 @@ class Callee {
465
465
auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
466
466
return Callee (
467
467
Kind::EnumElement, SGF, c, ci.FormalPattern , ci.FormalType ,
468
- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()), l);
468
+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()), l);
469
469
}
470
470
static Callee forClassMethod (SILGenFunction &SGF,
471
471
SILDeclRef c, SubstitutionMap subs,
472
472
SILLocation l) {
473
473
auto base = c.getOverriddenVTableEntry ();
474
474
auto &baseCI = SGF.getConstantInfo (SGF.getTypeExpansionContext (), base);
475
475
auto &derivedCI = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
476
- subs = subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ());
476
+ subs = substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ());
477
477
478
478
// We use an orig function type based on the overridden vtable entry, but
479
479
// the substitutions we have are for the current function. To get subs
@@ -497,7 +497,7 @@ class Callee {
497
497
SILDeclRef c, SubstitutionMap subs,
498
498
SILLocation l) {
499
499
auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
500
- subs = subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ());
500
+ subs = substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ());
501
501
auto origFunctionType = ci.FormalPattern .withSubstitutions (subs);
502
502
return Callee (
503
503
Kind::SuperMethod, SGF, c, origFunctionType, ci.FormalType , subs, l);
@@ -524,7 +524,7 @@ class Callee {
524
524
auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
525
525
return Callee (
526
526
Kind::WitnessMethod, SGF, c, ci.FormalPattern , ci.FormalType ,
527
- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()), l);
527
+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()), l);
528
528
}
529
529
static Callee forDynamic (SILGenFunction &SGF,
530
530
SILDeclRef c, SubstitutionMap constantSubs,
@@ -550,7 +550,7 @@ class Callee {
550
550
551
551
return Callee (
552
552
Kind::DynamicMethod, SGF, c, origFormalType, substFormalType,
553
- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()), l);
553
+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()), l);
554
554
}
555
555
556
556
static Callee formCallee (SILGenFunction &SGF, AbstractFunctionDecl *decl,
0 commit comments