try narrowing conversion

This commit is contained in:
anna
2011-06-07 12:14:20 +04:00
parent eb54cf6fe5
commit ca8f1063b2
3 changed files with 28 additions and 11 deletions
@@ -31,3 +31,21 @@ public class Test {
IConverter<String> converter2 = <error descr="Inferred type 'java.lang.String' for type parameter 'C' is not within its bound; should extend 'java.lang.Double'">getConverter2(String.class)</error>;
}
}
class Z {
}
class TestNonNarrowingConversion<T extends Z> {
public TestNonNarrowingConversion(T u) {
}
public T z = null;
public int a() {
<error descr="Incompatible types. Found: 'TestNonNarrowingConversion<Z>', required: 'TestNonNarrowingConversion<T>'">TestNonNarrowingConversion<T> x = new TestNonNarrowingConversion<Z>(new Z());</error>
return 1;
}
}