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

basic and raw formatters do not display captured var id properly when javac runs in -XDoldDiags mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7
    • 7
    • tools
    • b64
    • unknown
    • generic
    • Verified

      Compiling the following program:

      interface List<E> {}

      class Test {
         <T> void merge(List<T> l1, List<T> l2) {}
         void test(List<? extends Test> list) {
          merge(list, list);
         }
      }

      produces the following bad output if the compatibility mode flag (-XDoldDiags) is set:

      TestX.java:6: method merge in class Test cannot be applied to given types
          merge(list, list);
          ^
        required: List<T>,List<T>
        found: List<capture#0 of ? extends Test>,List<capture#0 of ? extends Test>
      1 error

      That is, captured var indexes are not generated correctly.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: