Skip to content

Commit 2b10c4c

Browse files
Harlan Haskinsjrose-apple
authored andcommitted
[ParseableInterfaces] Don’t print @escaping on enum elements
@escaping is implied here, and invalid when explicitly used. rdar://48298527
1 parent 39745a1 commit 2b10c4c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,8 +2781,13 @@ void PrintAST::printEnumElement(EnumElementDecl *elt) {
27812781
->castTo<AnyFunctionType>()
27822782
->getParams();
27832783
}
2784+
2785+
// @escaping is not valid in enum element position, even though the
2786+
// attribute is implicitly added. Ignore it when printing the parameters.
2787+
Options.ExcludeAttrList.push_back(TAK_escaping);
27842788
printParameterList(PL, params,
27852789
/*isAPINameByDefault*/true);
2790+
Options.ExcludeAttrList.pop_back();
27862791
}
27872792

27882793
auto *raw = elt->getRawValueExpr();

0 commit comments

Comments
 (0)