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

No compilation error reported when a sealed class is declared without permits clause

    XMLWordPrintable

    Details

      Description

      The below code declares a sealed class without any permits clause. It should throw a compilation error. However, the compilation goes through successfully.

      final class Child extends Parent {
      }

      sealed class Parent {
          public int check() { return 1; }
      }

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: