good code is red: upper bound should move up if next parameter requires (IDEA-56696)

This commit is contained in:
anna
2010-07-23 13:57:13 +04:00
parent 0fea708d58
commit 3f399561c2
3 changed files with 32 additions and 1 deletions
@@ -0,0 +1,30 @@
public class NestedGenericGoodCodeIsRed {
public void main( String[] args ) {
satisfiesAllOf(isPositive(), isEqualTo(10.9));
satisfiesAllOf(isPositive(), isEqualTo(10));
Number num = null;
satisfiesAllOf(isPositive(), isEqualTo(num));
this.<Number>satisfiesAllOf<error descr="'satisfiesAllOf(NestedGenericGoodCodeIsRed.Predicate<? super java.lang.Number>, NestedGenericGoodCodeIsRed.Predicate<? super java.lang.Number>)' in 'NestedGenericGoodCodeIsRed' cannot be applied to '(NestedGenericGoodCodeIsRed.Predicate<java.lang.Number>, NestedGenericGoodCodeIsRed.Predicate<java.lang.Integer>)'">(isPositive(), isEqualTo(10))</error>;
}
public interface Predicate<T> {
}
public <ALL> void satisfiesAllOf( Predicate<? super ALL> first, Predicate<? super ALL> second ) {
}
public <POSITIVE extends Number> Predicate<POSITIVE> isPositive() {
return null;
}
public <EQUALTO extends Number> Predicate<EQUALTO> isEqualTo( EQUALTO target ) {
return null;
}
}