Skip to content

Commit 8c9edae

Browse files
committed
AST: Fix crash when printing not yet typechecked associated type decls
1 parent ec60c88 commit 8c9edae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,10 @@ namespace {
642642
void printAbstractTypeParamCommon(AbstractTypeParamDecl *decl,
643643
const char *name) {
644644
printCommon(decl, name);
645-
if (auto superclassTy = decl->getSuperclass()) {
646-
OS << " superclass='" << superclassTy->getString() << "'";
645+
if (decl->getDeclContext()->getGenericEnvironmentOfContext()) {
646+
if (auto superclassTy = decl->getSuperclass()) {
647+
OS << " superclass='" << superclassTy->getString() << "'";
648+
}
647649
}
648650
}
649651

0 commit comments

Comments
 (0)