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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 7
    • Affects Version/s: 7
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: