Skip to content

Commit c50280f

Browse files
committed
Sema: don’t print ‘final’ on accessors
1 parent ddef82a commit c50280f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,8 @@ void PrintAST::printAttributes(const Decl *D) {
977977
!VD->getAttrs().hasAttribute<FinalAttr>() &&
978978
// Don't print a redundant 'final' if printing a 'let' or 'static' decl.
979979
!(VarD && VarD->isLet()) &&
980-
getCorrectStaticSpelling(D) != StaticSpellingKind::KeywordStatic) {
980+
getCorrectStaticSpelling(D) != StaticSpellingKind::KeywordStatic &&
981+
VD->getKind() != DeclKind::Accessor) {
981982
Printer.printAttrName("final");
982983
Printer << " ";
983984
}

0 commit comments

Comments
 (0)