Skip to content

Commit e459a6d

Browse files
committed
KAPT: Always print parens on empty annotation parameters
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
1 parent 705c804 commit e459a6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/util/PrettyWithWorkarounds.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ private class PrettyWithWorkarounds(
5050
if (renderMetadata != null && tree.annotationType.toString() == METADATA_FQ_NAME.asString()) {
5151
print(renderMetadata.invoke(this, tree))
5252
}
53-
super.visitAnnotation(tree)
53+
print("@")
54+
printExpr(tree.annotationType)
55+
print("(")
56+
printExprs(tree.args)
57+
print(")")
5458
}
5559
}
5660

0 commit comments

Comments
 (0)