lambda: tests

This commit is contained in:
anna
2012-07-20 18:54:43 +02:00
parent 01aefae9db
commit 7f8362d025
11 changed files with 271 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
interface I {
void m();
}
interface I1<A> {
void m(A a);
}
interface I2<A> {
void m(A a1, A a2);
}
interface IV<A> {
void m(A... as);
}
class AmbiguityVarargs {
void foo(I s) { }
void foo(I1<String> s) { }
void foo(I2<String> s) { }
void foo(IV<String> s) { }
void test() {
foo(()->{});
foo<error descr="Ambiguous method call: both 'AmbiguityVarargs.foo(I1<String>)' and 'AmbiguityVarargs.foo(IV<String>)' match">((a1) -> {})</error>;
foo((a1, a2)->{});
}
}