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

parser confused by square brackets in qualified generic cast

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b46
    • CPU:
      unknown
    • OS:
      generic
    • Verification:
      Verified

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: