parser confused by square brackets in qualified generic cast

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 7
    • Affects Version/s: 7
    • Component/s: tools
    • b46
    • unknown
    • generic
    • Verified

      The following program does not compile:

      class A<X> {
          class B<Y> {}

          A<? extends Integer>.B<String> b;
          Object o = (A<Integer>.B<String>[][])b;
      }

      OUTPUT:
      maurizio@maurizio-laptop:~/Desktop$ testws/dist/bin/javac Test3.java
      Test3.java:5: ')' expected
      Object o = (A<Integer>.B<String>[])b;
      ^
      Test3.java:5: ';' expected
      Object o = (A<Integer>.B<String>[])b;
      ^
      Test3.java:5: illegal start of type
      Object o = (A<Integer>.B<String>[])b;
      ^
      3 errors

            Assignee:
            Maurizio Cimadamore
            Reporter:
            Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: