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

jshell - Non-sealed declarations sometimes break a snippet evaluation

    XMLWordPrintable

Details

    • b23

    Backports

      Description

        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);
        ```

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: