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

Sealed types not supported by jshell

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 15
    • 15
    • tools
    • None
    • b27

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

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: