least upper bound: pull unbounded wildcard up so types Number & Comparable<? extends Number & Comparable<?>> are produced instead of Number & Comparable<? extends Comparable<?>>

inferred type in bounds check cleanup: accept that inference result is not within its bounds and give the inference the second chance
This commit is contained in:
Anna Kozlova
2015-12-09 11:25:11 +01:00
parent 1402b31623
commit dd38082794
10 changed files with 73 additions and 130 deletions
@@ -1,6 +1,6 @@
class Test {
void bar() {
baz<error descr="'baz(S)' in 'Test' cannot be applied to '(java.io.Serializable & java.lang.Comparable<? extends java.io.Serializable & java.lang.Comparable<? extends java.lang.Comparable<?>>>)'">(foo(1, ""))</error>;
baz<error descr="'baz(S)' in 'Test' cannot be applied to '(java.io.Serializable & java.lang.Comparable<? extends java.io.Serializable & java.lang.Comparable<?>>)'">(foo(1, ""))</error>;
}
<T> T foo(T x, T y) {