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

JShell does not handle records properly

XMLWordPrintable

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

        See this jshell session:
        ---
        $ jshell -C--enable-preview -C-source -C14 -R--enable-preview
        | Welcome to JShell -- Version 14-internal
        | For an introduction type: /help intro

        jshell> record R(int i) {
        | Error:
        | reached end of file while parsing
        | record R(int i) {
        | ^

        jshell> record R(int i) {}

        jshell> new R(1)
        | Error:
        | cannot find symbol
        | symbol: class R
        | new R(1)
        | ^

        ---

        Several issues are visible here:
        -the completeness analysis fails to recognize "record R(int i) {" to be incomplete
        -when a complete record is provided, it cannot be instantiated

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

                Created:
                Updated:
                Resolved: