mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 17:07:05 +07:00
java 8: resolve conflicts choosing more specific return type (IDEA-98845)
This commit is contained in:
+30
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user