incomplete snippet from loaded files from command line is ignored

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 25
    • Affects Version/s: 11, 17, 21, 23
    • Component/s: tools
    • None
    • b20
    • generic
    • generic

      jshell seems to ignore syntax errors from loaded files and prints prompt

      File: t.jsh

      var x = (
      System.out.println("hello");
      /exit

      No error for wrong init expression for var "x"


      This behaviour is seen in JDK 11, 17, 21, 22 as well in addition to JDK 23

            Assignee:
            Jan Lahoda
            Reporter:
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: