javac accepts sealed annotations

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 16
    • Affects Version/s: 15, 16
    • Component/s: tools
    • 15

      the spec for sealed types [1] states:

      It is a compile-time error if an annotation type declaration has the modifier sealed. The compiler is currently accepting this code:

      public sealed @interface MyAnno {}

      non-sealed interface Foo extends MyAnno {}

      the compiler should be in sync with the spec.

      [1] http://cr.openjdk.java.net/~gbierman/jep360/jep360-20200526/specs/sealed-classes-jls.html#jls-9.6

      reported by Tagir at:
      https://mail.openjdk.java.net/pipermail/amber-dev/2020-August/006447.html

            Assignee:
            Vicente Arturo Romero Zaldivar
            Reporter:
            Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: