mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
new inference: report inference errors of containing call for lambdas
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ import java.util.function.Consumer;
|
||||
class Test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Iterable<Consumer<Reader>> i = Arrays.asList((r) -> <error descr="Unhandled exception: java.io.IOException">r.read()</error>);
|
||||
Iterable<Consumer<Reader>> i = Arrays.asList(<error descr="Unhandled exception: IOException">(r) -> r.read()</error>);
|
||||
Iterable<Consumer<Reader>> i1 = Arrays.<Consumer<Reader>>asList((r) -> <error descr="Unhandled exception: java.io.IOException">r.read()</error>);
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -9,7 +9,9 @@ class Test {
|
||||
|
||||
<R> SuperFoo<R> foo(I<R> ax) { return null; }
|
||||
|
||||
SuperFoo<String> ls = foo(() -> <error descr="Bad return type in lambda expression: Foo<X> cannot be converted to SuperFoo<R>">new Foo<>()</error>);
|
||||
SuperFoo<String> ls = foo(<error descr="inference variable R has incompatible bounds:
|
||||
equality constraints: String
|
||||
upper bounds: Object, Number">() -> new Foo<>()</error>);
|
||||
SuperFoo<Integer> li = foo(() -> new Foo<>());
|
||||
SuperFoo<?> lw = foo(() -> new Foo<>());
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@ class Test {
|
||||
<T extends Runnable> void call1(T t) {}
|
||||
|
||||
{
|
||||
call<error descr="'call(T)' in 'Test' cannot be applied to '(<lambda expression>)'">(() -> {})</error>;
|
||||
call(<error descr="Object is not a functional interface">() -> {}</error>);
|
||||
call1(() -> {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user