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(
797797 }
798798 }
799799
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+
800809 // Lower the witness thunk type with the requirement's abstraction level.
801810 auto witnessSILFnType = getNativeSILFunctionType (
802811 M.Types , TypeExpansionContext::minimal (), AbstractionPattern (reqtOrigTy),
@@ -805,8 +814,6 @@ SILFunction *SILGenModule::emitProtocolWitness(
805814
806815 // Mangle the name of the witness thunk.
807816 Mangle::ASTMangler NewMangler;
808- auto manglingConformance =
809- conformance.isConcrete () ? conformance.getConcrete () : nullptr ;
810817 std::string nameBuffer =
811818 NewMangler.mangleWitnessThunk (manglingConformance, requirement.getDecl ());
812819 // TODO(TF-685): Proper mangling for derivative witness thunks.
You can’t perform that action at this time.
0 commit comments