blob: e2ac37c8d2e3ad4875ae4cf3b51aab114e22f559 [file] [log] [blame]
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
class Test {
interface RunnableX extends Callable<String> {
void run() throws Exception;
default String call() throws Exception
{
run();
return null;
}
}
static void foo(RunnableX r){
System.out.println(r);
}
static void foo(Callable<List<?>> c){
System.out.println(c);
}
public void test() {
foo<error descr="Ambiguous method call: both 'Test.foo(RunnableX)' and 'Test.foo(Callable<List<?>>)' match">(()-> new ArrayList<Void>() )</error>;
}
}
class Test1 {
interface RunnableX extends Callable<List<?>> {
void run() throws Exception;
default List<?> call() throws Exception
{
run();
return null;
}
}
static void foo(RunnableX r){
System.out.println(r);
}
static void foo(Callable<List<?>> c){
System.out.println(c);
}
public void test() {
foo(()-> new ArrayList<Void>() );
}
}