-
Bug
-
Resolution: Fixed
-
P4
-
repo-valhalla
This is not allowed by the current spec [1]:
It is a compile-time error if an annotation interface declaration has the modifier sealed, or non-sealed, identity, or value (9.1.1.4).
So code code like:
value @interface I {} and
identity @interface I {}
should be rejected by the compiler
[1] http://cr.openjdk.java.net/~dlsmith/jep8277163/jep8277163-20220519/specs/value-objects-jls.html
It is a compile-time error if an annotation interface declaration has the modifier sealed, or non-sealed, identity, or value (9.1.1.4).
So code code like:
value @interface I {} and
identity @interface I {}
should be rejected by the compiler
[1] http://cr.openjdk.java.net/~dlsmith/jep8277163/jep8277163-20220519/specs/value-objects-jls.html