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

parser confused by square brackets in qualified generic cast

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 7
    • 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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: