mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
overload resolution: prefer candidates with functional formal type if lambda is passed; this way conflict would be resolved and nested error would be shown instead
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import java.util.function.*;
|
||||
|
||||
class Test {
|
||||
void foo(Function<String, String> f) {}
|
||||
void foo(String f) {}
|
||||
|
||||
{
|
||||
foo(a -> {
|
||||
String s = a.substring(0);
|
||||
<error descr="Missing return statement">}</error>);
|
||||
}
|
||||
|
||||
interface A {
|
||||
void m(String s);
|
||||
}
|
||||
|
||||
void bar(Function<String, String> f) {}
|
||||
void bar(A f) {}
|
||||
|
||||
{
|
||||
bar(a -> {
|
||||
String s = a.substring(0);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user