Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251355

javac accepts sealed annotations

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 15, 16
    • 16
    • tools
    • 15

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: