We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d113ca6 commit a9fb330Copy full SHA for a9fb330
lib/AST/ASTDumper.cpp
@@ -1033,10 +1033,20 @@ namespace {
1033
Indent -= 2;
1034
}
1035
1036
+
1037
if (D->hasSingleExpressionBody()) {
- OS << '\n';
1038
- printRec(D->getSingleExpressionBody());
1039
- } else if (auto Body = D->getBody(/*canSynthesize=*/false)) {
+ // There won't be an expression if this is an initializer that was
+ // originally spelled "init?(...) { nil }", because "nil" is modeled
1040
+ // via FailStmt in this context.
1041
+ if (auto *Body = D->getSingleExpressionBody()) {
1042
+ OS << '\n';
1043
+ printRec(Body);
1044
1045
+ return;
1046
+ }
1047
1048
1049
+ if (auto Body = D->getBody(/*canSynthesize=*/false)) {
1050
OS << '\n';
1051
printRec(Body, D->getASTContext());
1052
0 commit comments