java 8: resolve conflicts choosing more specific return type (IDEA-98845)

This commit is contained in:
anna
2013-01-11 18:55:34 +01:00
parent 7f67356440
commit c892ea7f32
5 changed files with 140 additions and 87 deletions
@@ -0,0 +1,30 @@
class IntStream {
private void foo(IntStream s) {
s.map(i -> 1 << i);
s.map(i -> 1);
s.map(i -> i);
}
public static void main(String[] args) {
new IntStream().foo(null);
}
private IntStream map(IntUnaryOperator mapper) {
System.out.println(mapper);
return null;
}
private <T> IntStream <warning descr="Private method 'map(ObjIntFunction<T>)' is never used">map</warning>(ObjIntFunction<T> mapper) {
System.out.println(mapper);
return null;
}
}
interface IntUnaryOperator {
public int applyAsInt(int operand);
}
interface ObjIntFunction<T> {
public T apply(int i);
}