Skip to content

Commit dd438c6

Browse files
committed
[AST] Mangling: protocol composition type mangling should respect AllowMarkerProtocols flag
1 parent 14626e4 commit dd438c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,13 @@ void ASTMangler::appendType(Type type, GenericSignature sig,
14681468

14691469
case TypeKind::ProtocolComposition: {
14701470
auto *PCT = cast<ProtocolCompositionType>(tybase);
1471+
1472+
if (!AllowMarkerProtocols) {
1473+
auto strippedTy = PCT->withoutMarkerProtocols();
1474+
if (!strippedTy->isEqual(PCT))
1475+
return appendType(strippedTy, sig, forDecl);
1476+
}
1477+
14711478
if (PCT->hasParameterizedExistential()
14721479
|| (PCT->hasInverse() && AllowInverses))
14731480
return appendConstrainedExistential(PCT, sig, forDecl);

0 commit comments

Comments
 (0)