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

jshell - Non-sealed declarations sometimes break a snippet evaluation

XMLWordPrintable

    • b23

        In JShell, the following snippet, when evaluated as a single block, fails after the `non-sealed class` declaration. The same snippet, evaluated line by line, works fine.

        ```
        sealed class Shape permits Square {};
        non-sealed class Square extends Shape {};
        Square sq = new Square();
        System.out.println("test -> "+ sq);
        ```

              jlahoda Jan Lahoda
              ddelabassee David Delabassee
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: