Confusing error message when match binding variable omitted in matches predicate

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P4
    • repo-amber
    • Affects Version/s: None
    • Component/s: tools
    • generic
    • generic

      While compiling the following:

      // ---
      public class X {
          public static void main(String [] args) {
              if (args __matches String) {
                  System.out.println("Broken");
              }
          }
      }

      // ---
      javac complains:

      /home/srikanth/tmp/X.java:3: error: cannot find symbol
              if (args __matches String) {
                                 ^
        symbol: variable String
        location: class X
      1 error

      This could be confusing to a user.

            Assignee:
            Jan Lahoda
            Reporter:
            Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: