mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
static interface method: if called on wrong qualifier mark as static problem (IDEA-139651)
This commit is contained in:
@@ -20,6 +20,6 @@ class Bug {
|
||||
|
||||
Function<Integer, Integer> g = <error descr="Static method may be invoked on containing interface class only">f.identity();</error>
|
||||
|
||||
Function<Integer, Integer> h = <error descr="Static method may be invoked on containing interface class only">IFunction.identity();</error>
|
||||
Function<Integer, Integer> h = IFunction.<error descr="Static method may be invoked on containing interface class only">identity</error>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import java.util.function.Function;
|
||||
|
||||
interface Test<R> {
|
||||
|
||||
static <T, R> Inner<R> go(T t, Function<T, R> f) {
|
||||
return new Inner<>();
|
||||
}
|
||||
|
||||
class Inner<R> implements Test<R> {
|
||||
|
||||
<T> Inner<R> go(T t, Function<T, R> f) {
|
||||
return new Inner<>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
class App {
|
||||
|
||||
void run(Test.Inner<Integer> go) {
|
||||
|
||||
Test.Inner<Integer> test = go.go(1, (Integer i) -> i);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user