Skip to content

Commit dfc940f

Browse files
committed
[ASTDumper] Check null for getExtendedTypeRepr
This can be null for `extension {}`.
1 parent a5a8cf4 commit dfc940f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,9 +2131,9 @@ namespace {
21312131
printFlag(!ED->hasBeenBound(), "unbound");
21322132
if (ED->hasBeenBound()) {
21332133
printTypeField(ED->getExtendedType(), Label::optional("extended_type"));
2134-
} else {
2134+
} else if (auto *extTypeRepr = ED->getExtendedTypeRepr()) {
21352135
printNameRaw([&](raw_ostream &OS) {
2136-
ED->getExtendedTypeRepr()->print(OS);
2136+
extTypeRepr->print(OS);
21372137
}, Label::optional("extended_type"));
21382138
}
21392139
printCommonPost(ED);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: not %target-swift-frontend %s -dump-parse
2+
extension {}

0 commit comments

Comments
 (0)