IDEA-112555 Bad code is green with method references on instance

This commit is contained in:
Anna Kozlova
2013-08-26 18:07:34 +04:00
parent 8f5139db60
commit 04a76c3faf
4 changed files with 30 additions and 3 deletions

View File

@@ -0,0 +1,15 @@
class ThreadExample {
interface Function<T, R> {
R apply(T t);
}
{
A a = new A();
<error descr="Incompatible types. Found: '<method reference>', required: 'ThreadExample.Function<? super ThreadExample.A,? extends java.lang.String>'">Function<? super A,? extends String> foo = a::foo;</error>
}
static class A {
public String foo() { return "a"; }
}
}