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

JShell does not handle records properly

    XMLWordPrintable

    Details

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

      Backports

        Description

        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

          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: