capture conversion: ensure captured wildcards are not replaced after creation, so substitution is consistent; at the same time ensure that "?" with upper bound Runnable is equivalent to "? extends Runnable"

This commit is contained in:
Anna Kozlova
2015-05-28 19:42:11 +02:00
parent 719bfffcae
commit cdb50293f2
14 changed files with 57 additions and 20 deletions
@@ -19,7 +19,7 @@ class SortTest<R extends Comparable<R>> implements Comparable<SortTest<R>> {
SortTest<?> t2 = new SortTest<Integer>(0);
list.add(t2);
Collections.sort<error descr="'sort(java.util.List<T>)' in 'java.util.Collections' cannot be applied to '(java.util.ArrayList<SortTest<?>>)'">(list)</error>;
t1.compareTo<error descr="'compareTo(SortTest<capture<? extends java.lang.Comparable<capture<?>>>>)' in 'SortTest' cannot be applied to '(SortTest<capture<? extends java.lang.Comparable<capture<?>>>>)'">(t2)</error>;
t1.compareTo<error descr="'compareTo(SortTest<capture<?>>)' in 'SortTest' cannot be applied to '(SortTest<capture<?>>)'">(t2)</error>;
//this should be OK
SortTest<?>[] arr = new SortTest<?>[0];