7177385: Add attribution support for lambda expressions

Add support for function descriptor lookup, functional interface inference and lambda expression type-checking

Reviewed-by: jjg, dlsmith
This commit is contained in:
Maurizio Cimadamore 2012-10-05 14:35:24 +01:00
parent c0e2ed86c1
commit 72f39bf20c
41 changed files with 1847 additions and 189 deletions

View file

@ -23,7 +23,8 @@
// key: compiler.err.cant.ref.non.effectively.final.var
// key: compiler.misc.inner.cls
// options: -XDallowEffectivelyFinalInInnerClasses
// key: compiler.misc.lambda
// options: -XDallowLambda -XDallowEffectivelyFinalInInnerClasses
class CantRefNonEffectivelyFinalVar {
void test() {
@ -31,4 +32,14 @@ class CantRefNonEffectivelyFinalVar {
new Object() { int j = i; };
i = 2;
}
interface SAM {
void m();
}
void test2() {
int i = 0;
SAM s = ()-> { int j = i; };
i++;
}
}