Skip to content

Commit 3a361c7

Browse files
committed
[Attr] Implement printing the typeEraser attribute.
1 parent 3032dbd commit 3a361c7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/AST/Attr.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,20 @@ bool DeclAttribute::printImpl(ASTPrinter &Printer, const PrintOptions &Options,
985985
break;
986986
}
987987

988+
case DAK_TypeEraser: {
989+
Printer.printAttrName("@_typeEraser");
990+
Printer << "(";
991+
Printer.callPrintNamePre(PrintNameContext::Attribute);
992+
auto typeLoc = cast<TypeEraserAttr>(this)->getTypeEraserLoc();
993+
if (auto type = typeLoc.getType())
994+
type->print(Printer, Options);
995+
else
996+
typeLoc.getTypeRepr()->print(Printer, Options);
997+
Printer.printNamePost(PrintNameContext::Attribute);
998+
Printer << ")";
999+
break;
1000+
}
1001+
9881002
case DAK_Custom: {
9891003
Printer.callPrintNamePre(PrintNameContext::Attribute);
9901004
Printer << "@";

0 commit comments

Comments
 (0)