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

JShell: poor disambiguation of less-than from type-argument

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 10
    • 9
    • tools
    • None

      jshell> int a
      a ==> 0

      jshell> a < 4
      | Error:
      | illegal start of type
      | a < 4
      | ^

      jshell> int b
      b ==> 0

      jshell> a < b
      | Error:
      | reached end of file while parsing
      | a < b
      | ^

      ----

      Caused by

          t = term(EXPR | TYPE);

      In ReplParser.replUnit()

      Which causes JavacParser.typeArguments() to fail.

        1. dif
          15 kB
          Robert Field

            rfield Robert Field (Inactive)
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: