Confusing error and bad co-ordinates while compiling patterns code.

XMLWordPrintable

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

      public class X {
          public static void main(String [] args) {
              Object o = args;
              switch (o) {
                 case int x:
                     System.out.println("int x");
                     break;
              }
          }
      }

      while compiling results in:

      /home/srikanth/tmp/X.java:1: error: bad operand types for binary operator '=='
      public class X {
      ^
        first type: int
        second type: Object
      1 error

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

              Created:
              Updated:
              Resolved: