[sealed] javac accepts sealed annotations
Vicente Romero
vicente.romero at oracle.com
Mon Aug 10 15:16:39 UTC 2020
Hi Tagir,
Thanks for the report. I have created [1] to track it,
Vicente
[1] https://bugs.openjdk.java.net/browse/JDK-8251355
On 8/10/20 7:04 AM, Tagir Valeev wrote:
> Hello!
>
> My colleague discovered that latest javac (both 15-ea and 16-ea)
> accepts sealed annotations. E.g.:
>
> public sealed @interface MyAnno {
> }
> non-sealed interface Foo extends MyAnno {
> }
>
> The spec draft explicitly forbids this [1]:
>> It is a compile-time error if an annotation type declaration has the modifier sealed (9.1.1.3).
> With best regards,
> Tagir Valeev.
>
> [1] http://cr.openjdk.java.net/~gbierman/jep360/jep360-20200526/specs/sealed-classes-jls.html#jls-9.6
More information about the amber-dev
mailing list