method refs: prefer unhandled exception to wrong return type error (IDEA-160251)

This commit is contained in:
Anna Kozlova
2016-08-25 17:36:03 +03:00
parent 5de45cb0af
commit 2ec75e05a1
3 changed files with 43 additions and 20 deletions
@@ -0,0 +1,21 @@
import java.util.List;
class Test {
@FunctionalInterface
interface SomeInterface<T, R> {
R someMethod(T val);
}
public <T, R> void consume(SomeInterface<T, R> someInterface) {
}
private List<Integer> produce(Integer val) throws Exception {
return null;
}
public void failure() {
consume(<error descr="Unhandled exception: java.lang.Exception">this::produce</error>);
}
}