new inference: reject to infer variables if it's upper bound doesn't agree with lower/equal bound (when present)

This commit is contained in:
Anna Kozlova
2015-02-19 18:07:55 +01:00
parent 7bdb789b45
commit b06817081b
8 changed files with 23 additions and 15 deletions
@@ -3,6 +3,6 @@ abstract class A<S> {
{
A<?> a = null;
<error descr="Inferred type 'A<capture<?>>' for type parameter 'T' is not within its bound; should extend 'A<? extends java.lang.Throwable>'">foo(a)</error>;
foo<error descr="'foo(T)' in 'A' cannot be applied to '(A<capture<?>>)'">(a)</error>;
}
}
@@ -4,7 +4,7 @@ class CLS {
static <V extends String> void bar (V v) {}
static void foo () {
<error descr="Inferred type 'java.lang.Object' for type parameter 'V' is not within its bound; should extend 'java.lang.String'">bar(new Object())</error>;
bar<error descr="'bar(V)' in 'CLS' cannot be applied to '(java.lang.Object)'">(new Object())</error>;
}
}
//////////////////////////////