Skip to content

Commit fab3576

Browse files
authored
Merge pull request #31200 from AnthonyLatsis/typealias-dump
ASTDumper: Fix missing trailing apostrophe when dumping typealias und…
2 parents 54fd54c + a50b2cd commit fab3576

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -630,17 +630,16 @@ namespace {
630630

631631
void visitTypeAliasDecl(TypeAliasDecl *TAD) {
632632
printCommon(TAD, "typealias");
633-
PrintWithColorRAII(OS, TypeColor) << " type='";
633+
PrintWithColorRAII(OS, TypeColor) << " type=";
634634
if (auto underlying = TAD->getCachedUnderlyingType()) {
635635
PrintWithColorRAII(OS, TypeColor)
636-
<< underlying.getString();
636+
<< "'" << underlying.getString() << "'";
637637
} else {
638638
PrintWithColorRAII(OS, TypeColor) << "<<<unresolved>>>";
639639
}
640-
printInherited(TAD->getInherited());
641-
OS << "')";
640+
PrintWithColorRAII(OS, ParenthesisColor) << ')';
642641
}
643-
642+
644643
void visitOpaqueTypeDecl(OpaqueTypeDecl *OTD) {
645644
printCommon(OTD, "opaque_type");
646645
OS << " naming_decl=";
@@ -3470,9 +3469,10 @@ namespace {
34703469
void visitTypeAliasType(TypeAliasType *T, StringRef label) {
34713470
printCommon(label, "type_alias_type");
34723471
printField("decl", T->getDecl()->printRef());
3473-
PrintWithColorRAII(OS, TypeColor) << " underlying='";
3472+
PrintWithColorRAII(OS, TypeColor) << " underlying=";
34743473
if (auto underlying = T->getSinglyDesugaredType()) {
3475-
PrintWithColorRAII(OS, TypeColor) << underlying->getString();
3474+
PrintWithColorRAII(OS, TypeColor)
3475+
<< "'" << underlying->getString() << "'";
34763476
} else {
34773477
PrintWithColorRAII(OS, TypeColor) << "<<<unresolved>>>";
34783478
}

0 commit comments

Comments
 (0)