Skip to content

Commit ff05efe

Browse files
committed
Print nominal AST extended types
1 parent c283028 commit ff05efe

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,20 +1760,8 @@ static void printExtendedTypeName(Type ExtendedType, ASTPrinter &Printer,
17601760
PrintOptions Options) {
17611761
auto Nominal = ExtendedType->getAnyNominal();
17621762
assert(Nominal && "extension of non-nominal type");
1763-
if (auto ct = ExtendedType->getAs<ClassType>()) {
1764-
if (auto ParentType = ct->getParent()) {
1765-
ParentType.print(Printer, Options);
1766-
Printer << ".";
1767-
}
1768-
}
1769-
if (auto st = ExtendedType->getAs<StructType>()) {
1770-
if (auto ParentType = st->getParent()) {
1771-
ParentType.print(Printer, Options);
1772-
Printer << ".";
1773-
}
1774-
}
1775-
if (auto et = ExtendedType->getAs<EnumType>()) {
1776-
if (auto ParentType = et->getParent()) {
1763+
if (auto nt = ExtendedType->getAs<NominalType>()) {
1764+
if (auto ParentType = nt->getParent()) {
17771765
ParentType.print(Printer, Options);
17781766
Printer << ".";
17791767
}

0 commit comments

Comments
 (0)