Skip to content

Commit 6c88ca7

Browse files
committed
ASTMangler: fix mangling of generic ObjC types
The mangled context must match the number of type argument lists. This was not the case if the bound generic nominal had a special mangling context. rdar://problem/53418742
1 parent da38e25 commit 6c88ca7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/AST/ASTMangler.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,11 @@ void ASTMangler::appendBoundGenericArgs(Type type, bool &isFirstArgList) {
12311231
} else {
12321232
auto boundType = cast<BoundGenericType>(typePtr);
12331233
genericArgs = boundType->getGenericArgs();
1234-
if (Type parent = boundType->getParent())
1235-
appendBoundGenericArgs(parent->getDesugaredType(), isFirstArgList);
1234+
if (Type parent = boundType->getParent()) {
1235+
GenericTypeDecl *decl = boundType->getAnyGeneric();
1236+
if (!getSpecialManglingContext(decl, UseObjCProtocolNames))
1237+
appendBoundGenericArgs(parent->getDesugaredType(), isFirstArgList);
1238+
}
12361239
}
12371240
if (isFirstArgList) {
12381241
appendOperator("y");

0 commit comments

Comments
 (0)