mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
lambda/method refs: more specific according to 15.12.2.5 - prefer private when private type is given/reference when reference type is given
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
class Test {
|
||||
static class Inner {
|
||||
int foo() { return 0; }
|
||||
Integer fooBoxed() { return 0; }
|
||||
}
|
||||
|
||||
void test(Stream<Inner> sp) {
|
||||
IntStream mi = sp.map(Inner::foo);
|
||||
Stream<Integer> mI = sp.map(Inner::fooBoxed);
|
||||
|
||||
IntStream li = sp.map(inner->inner.foo());
|
||||
Stream<Integer> lI = sp.map(inner -> inner.fooBoxed());
|
||||
}
|
||||
|
||||
interface Stream<T> {
|
||||
<R> Stream<R> map(Function<? super T, ? extends R> mapper);
|
||||
IntStream map(IntFunction<? super T> mapper);
|
||||
}
|
||||
|
||||
interface Function<T, R> {
|
||||
public R _(T t);
|
||||
}
|
||||
|
||||
interface IntFunction<T> {
|
||||
public int _(T t);
|
||||
}
|
||||
|
||||
interface IntStream {}
|
||||
}
|
||||
Reference in New Issue
Block a user