Skip to content

Commit 52194b2

Browse files
committed
Fix dependent conformance mangling for multiple opaque result types.
We were always mangling based on the last generic parameter, which makes sense when there is only one opaque result type, but is incorrect when there are multiple opaque result types, e.g., due to named or structural opaque result types.
1 parent 2e60f2a commit 52194b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3315,10 +3315,10 @@ void ASTMangler::appendAnyProtocolConformance(
33153315
appendDependentProtocolConformance(path, genericSig);
33163316
} else if (auto opaqueType = conformingType->getAs<OpaqueTypeArchetypeType>()) {
33173317
GenericSignature opaqueSignature = opaqueType->getBoundSignature();
3318-
GenericTypeParamType *opaqueTypeParam = opaqueSignature.getGenericParams().back();
33193318
ConformanceAccessPath conformanceAccessPath =
3320-
opaqueSignature->getConformanceAccessPath(opaqueTypeParam,
3321-
conformance.getAbstract());
3319+
opaqueSignature->getConformanceAccessPath(
3320+
opaqueType->getInterfaceType(),
3321+
conformance.getAbstract());
33223322

33233323
// Append the conformance access path with the signature of the opaque type.
33243324
appendDependentProtocolConformance(conformanceAccessPath, opaqueSignature);

0 commit comments

Comments
 (0)