mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-24 09:20:53 +07:00
IDEA-112555 Bad code is green with method references on instance
This commit is contained in:
@@ -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"; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user