- 
    Bug 
- 
    Resolution: Fixed
- 
     P3 P3
- 
    7
- 
        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.
            
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.
- relates to
- 
                    JDK-6722234 javac diagnostics need better integration with the type-system -           
- Closed
 
-         
- 
                    JDK-6852649 The Rich formatter printer should be an explicit class to facilitate overriding -           
- Closed
 
-