static interface method: if called on wrong qualifier mark as static problem (IDEA-139651)

This commit is contained in:
Anna Kozlova
2015-04-27 19:01:19 +02:00
parent dff58a4600
commit 02e86e0ab9
5 changed files with 40 additions and 3 deletions

View File

@@ -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>();
}
}

View File

@@ -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);
}
}