mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
lambda: tests
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
interface I<K, V> {
|
||||
public V put(K k, V v);
|
||||
}
|
||||
|
||||
interface A<T>{}
|
||||
interface B<L> extends A<L>{}
|
||||
|
||||
interface SameArgsI<T> {
|
||||
T same(T a, T b);
|
||||
}
|
||||
|
||||
class InferenceFromArgs {
|
||||
|
||||
private static <E> void bar(A<? extends E> a, I<? super E, Integer> i) { }
|
||||
|
||||
void foo(B<Integer> b) {
|
||||
bar(b, (k, v) -> {int i = k; int j = v; return Math.max(i, j);});
|
||||
}
|
||||
|
||||
public static <T> SameArgsI<T> max() {
|
||||
return (a, b) -> b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user