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

Sealed Classes: clarify treatment of `non-sealed` as a keyword

    Details

      Description

      Currently the spec describes the string `non-sealed` as a reserved keyword. This means that according to the spec the following code should fail to compile:

      int test(int non, int sealed) {
        return non-sealed;
      }

      However, this code compiles correctly (with the preview enabled). The spec should be updated with a notion of *contextual keyword* to allow `non-sealed` to be considered a keyword only in the places where needed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dlsmith Dan Smith
                Reporter:
                gbierman Gavin Bierman
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: