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

Sealed types not supported by jshell

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 15
    • 15
    • tools
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: