-
Bug
-
Resolution: Fixed
-
P4
-
21, 22
-
Happens on 21, and 22b22
-
b23
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8320765 | 21.0.2 | Jan Lahoda | P4 | Resolved | Fixed | b09 |
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);
```
```
sealed class Shape permits Square {};
non-sealed class Square extends Shape {};
Square sq = new Square();
System.out.println("test -> "+ sq);
```
- backported by
-
JDK-8320765 jshell - Non-sealed declarations sometimes break a snippet evaluation
- Resolved