File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -797,6 +797,15 @@ SILFunction *SILGenModule::emitProtocolWitness(
797
797
}
798
798
}
799
799
800
+ ProtocolConformance *manglingConformance = nullptr ;
801
+ if (conformance.isConcrete ()) {
802
+ manglingConformance = conformance.getConcrete ();
803
+ if (auto *inherited = dyn_cast<InheritedProtocolConformance>(manglingConformance)) {
804
+ manglingConformance = inherited->getInheritedConformance ();
805
+ conformance = ProtocolConformanceRef (manglingConformance);
806
+ }
807
+ }
808
+
800
809
// Lower the witness thunk type with the requirement's abstraction level.
801
810
auto witnessSILFnType = getNativeSILFunctionType (
802
811
M.Types , TypeExpansionContext::minimal (), AbstractionPattern (reqtOrigTy),
@@ -805,8 +814,6 @@ SILFunction *SILGenModule::emitProtocolWitness(
805
814
806
815
// Mangle the name of the witness thunk.
807
816
Mangle::ASTMangler NewMangler;
808
- auto manglingConformance =
809
- conformance.isConcrete () ? conformance.getConcrete () : nullptr ;
810
817
std::string nameBuffer =
811
818
NewMangler.mangleWitnessThunk (manglingConformance, requirement.getDecl ());
812
819
// TODO(TF-685): Proper mangling for derivative witness thunks.
You can’t perform that action at this time.
0 commit comments