@@ -452,7 +452,7 @@ class Callee {
452452 auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
453453 return Callee (
454454 SGF, c, ci.FormalPattern , ci.FormalType ,
455- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()),
455+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()),
456456 subs,
457457 l,
458458 callPreviousDynamicReplaceableImpl);
@@ -465,15 +465,15 @@ class Callee {
465465 auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
466466 return Callee (
467467 Kind::EnumElement, SGF, c, ci.FormalPattern , ci.FormalType ,
468- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()), l);
468+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()), l);
469469 }
470470 static Callee forClassMethod (SILGenFunction &SGF,
471471 SILDeclRef c, SubstitutionMap subs,
472472 SILLocation l) {
473473 auto base = c.getOverriddenVTableEntry ();
474474 auto &baseCI = SGF.getConstantInfo (SGF.getTypeExpansionContext (), base);
475475 auto &derivedCI = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
476- subs = subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ());
476+ subs = substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ());
477477
478478 // We use an orig function type based on the overridden vtable entry, but
479479 // the substitutions we have are for the current function. To get subs
@@ -497,7 +497,7 @@ class Callee {
497497 SILDeclRef c, SubstitutionMap subs,
498498 SILLocation l) {
499499 auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
500- subs = subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ());
500+ subs = substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ());
501501 auto origFunctionType = ci.FormalPattern .withSubstitutions (subs);
502502 return Callee (
503503 Kind::SuperMethod, SGF, c, origFunctionType, ci.FormalType , subs, l);
@@ -524,7 +524,7 @@ class Callee {
524524 auto &ci = SGF.getConstantInfo (SGF.getTypeExpansionContext (), c);
525525 return Callee (
526526 Kind::WitnessMethod, SGF, c, ci.FormalPattern , ci.FormalType ,
527- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()), l);
527+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()), l);
528528 }
529529 static Callee forDynamic (SILGenFunction &SGF,
530530 SILDeclRef c, SubstitutionMap constantSubs,
@@ -550,7 +550,7 @@ class Callee {
550550
551551 return Callee (
552552 Kind::DynamicMethod, SGF, c, origFormalType, substFormalType,
553- subs. mapIntoTypeExpansionContext ( SGF.getTypeExpansionContext ()), l);
553+ substOpaqueTypesWithUnderlyingTypes (subs, SGF.getTypeExpansionContext ()), l);
554554 }
555555
556556 static Callee formCallee (SILGenFunction &SGF, AbstractFunctionDecl *decl,
0 commit comments