C style array declaration not accepted in pattern binding declaration

XMLWordPrintable

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

      (This should perhaps be closed as won't fix ?)

      Note that asymmetry in javac's treatment between argv array and the pattern binding variable array.

      public class X {

          public static void main(String args[]) {
              Object o = null;
              if (o __matches String x []) {
              }
          }
      }

      This program fails to compiler and elicits the following:

      /home/srikanth/tmp/X.java:5: error: ')' expected
              if (o __matches String x []) {
                                      ^
      /home/srikanth/tmp/X.java:5: error: illegal start of expression
              if (o __matches String x []) {
                                       ^
      2 errors


            Assignee:
            Unassigned
            Reporter:
            Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: