lambda: infer from return type; cyclic inference stop

This commit is contained in:
Anna Kozlova
2012-08-10 22:41:35 +04:00
parent bff2c6d55c
commit 5ba5425a54
22 changed files with 642 additions and 207 deletions

View File

@@ -0,0 +1,20 @@
class NoLambda {
interface I<T> {
void f(T t);
}
<Z> void bar(I<Z> iz) {
}
void bazz() {
bar(null);
bar(<error descr="Cyclic inference">(z)-> {System.out.println();}</error>);
}
static <T> T id(T i2) {return i2;}
{
id(<error descr="Cyclic inference">() -> {System.out.println("hi");}</error>);
NoLambda.<Runnable>id(() -> {System.out.println("hi");});
}
}