Skip to content

Commit cd9d202

Browse files
authored
Merge pull request #74550 from hamishknight/dump-respect-skip
[ASTDumper] Respect function body skipping
2 parents 4bec599 + 82cc240 commit cd9d202

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,8 @@ namespace {
15611561
});
15621562
}
15631563

1564-
if (auto Body = D->getBody(/*canSynthesize=*/ParseIfNeeded)) {
1564+
auto canParse = ParseIfNeeded && !D->isBodySkipped();
1565+
if (auto Body = D->getBody(canParse)) {
15651566
printRec(Body, &D->getASTContext());
15661567
}
15671568
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %target-swift-frontend -dump-parse -experimental-skip-all-function-bodies %s | %FileCheck %s
2+
3+
func foo() {
4+
print("hello")
5+
}
6+
// CHECK-NOT: brace_stmt

0 commit comments

Comments
 (0)