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

JShell: Records with errors are not properly corraled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 14
    • 14
    • tools
    • b32

        As reported here:
        https://mail.openjdk.java.net/pipermail/amber-dev/2019-December/005415.html

        Declaring a record which uses an undeclared variable does not work properly:
        ---
        jshell> record R(int i) { public int g() { return unknown; } }

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

        jshell>
        ---

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

                Created:
                Updated:
                Resolved: