JShell does not handle records properly

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 14
    • Affects Version/s: 14
    • Component/s: 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

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

                Created:
                Updated:
                Resolved: