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

Sealed types not supported by jshell

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b27

      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
      ---

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              jlahoda Jan Lahoda
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: