mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 22:11:40 +07:00
overload resolution: compare functional interfaces for specific if they are not assignable (IDEA-140987)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
private static <T> T withProject(final Function<ProjectEnvironment, T> calculation) {
|
||||
System.out.println(calculation);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static <T> T <warning descr="Private method 'withProject(java.util.function.Consumer<ProjectEnvironment>)' is never used">withProject</warning>(final Consumer<ProjectEnvironment> calculation){
|
||||
System.out.println(calculation);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String foo() {
|
||||
return withProject(ProjectEnvironment::getProject);
|
||||
}
|
||||
}
|
||||
|
||||
class ProjectEnvironment {
|
||||
String getProject() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user