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

incomplete snippet from loaded files from command line is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • 25
    • 11, 17, 21, 23
    • tools
    • None
    • 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

            jlahoda Jan Lahoda
            sundar Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: