Skip to content

Commit 26c5077

Browse files
authored
Fix AST dump generation for enum_is_case_expr
AST Dumper at the moment generates invalid AST dump output for `enum_is_case_expr` Currently it `forgets` to add a closing bracket, which leads to unparsable AST dump output. ``` (if_stmt implicit\ (call_expr implicit type='Int1' nothrow arg_labels=\ (dot_syntax_call_expr implicit type='() -> Int1' nothrow\ (declref_expr implicit type='(Bool) -> () -> Int1' decl=Swift.(file).Bool._getBuiltinLogicValue() function_ref=double)\ (enum_is_case_expr implicit type='Bool' some\ (declref_expr implicit type='UIBarButtonItem?' decl=The.(file).Controller.<anonymous>.tmp1 direct_to_storage function_ref=unapplied))\ # <--- One Bracked is missing here (tuple_expr implicit type='()'))\ (return_stmt implicit\ (force_value_expr implicit type='UIBarButtonItem'\ (declref_expr implicit type='UIBarButtonItem?' decl=The.(file).Controller.<anonymous>.tmp1 direct_to_storage function_ref=unapplied))))\ ```
1 parent 4695214 commit 26c5077

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
23432343
printCommon(E, "enum_is_case_expr") << ' ' <<
23442344
E->getEnumElement()->getName() << "\n";
23452345
printRec(E->getSubExpr());
2346-
2346+
PrintWithColorRAII(OS, ParenthesisColor) << ')';
23472347
}
23482348
void visitUnresolvedPatternExpr(UnresolvedPatternExpr *E) {
23492349
printCommon(E, "unresolved_pattern_expr") << '\n';

0 commit comments

Comments
 (0)