Skip to content

Commit

Permalink
KAPT: Always print parens on empty annotation parameters
Browse files Browse the repository at this point in the history
Since JDK 17+ pretty-printer does not print parens on empty annotation
parameters, print them anyway. Otherwise, tests with annotations differ
on different JDKs.
 #KT-57389
  • Loading branch information
ilmirus committed Nov 22, 2023
1 parent 705c804 commit e459a6d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ private class PrettyWithWorkarounds(
if (renderMetadata != null && tree.annotationType.toString() == METADATA_FQ_NAME.asString()) {
print(renderMetadata.invoke(this, tree))
}
super.visitAnnotation(tree)
print("@")
printExpr(tree.annotationType)
print("(")
printExprs(tree.args)
print(")")
}
}

Expand Down

0 comments on commit e459a6d

Please sign in to comment.