mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 15:41:26 +07:00
new inference: provide incomplete inference results for lambda (IDEA-162035; IDEA-155230)
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class A {
|
||||
{
|
||||
run(A.class, this, (o) -> {
|
||||
o.meth();
|
||||
<error descr="Missing return statement">}</error>);
|
||||
|
||||
|
||||
Map<Integer, Integer> map = Stream.iterate(5, <error descr="no instance(s) of type variable(s) T exist so that Stream<T> conforms to Map<Integer, Integer>">t -> t + 5</error>);
|
||||
}
|
||||
|
||||
|
||||
void meth() {}
|
||||
|
||||
<T> T run(Class<T> c, T t, Function<T, T> f) {
|
||||
return f.apply(t);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user