JDK-8246353 : Sealed types not supported by jshell
  • Type: Bug
  • Component: tools
  • Sub-Component: jshell
  • Affected Version: 15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-06-02
  • Updated: 2024-10-17
  • Resolved: 2020-06-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b27Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
JShell does not support sealed types properly, e.g.:
---
jshell> sealed class B permits I {}
|  created class B, however, it cannot be referenced until class I is declared

jshell> final class I extends B {}
|  Warning:
|  Modifier 'final' not permitted in top-level declarations, ignored
|  final class I extends B {}
|  ^---^
|  created class I, however, it cannot be referenced until class B is declared and this error is corrected: 
|      Modifier 'final' not permitted in top-level declarations, ignored
|      final class I extends B {}
|      ^---^

jshell> class I extends B {}
|  modified class I, however, it cannot be referenced until class B is declared
---

Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/58e5f682e8d4 User: jlahoda Date: 2020-06-08 15:03:28 +0000
08-06-2020