mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 02:54:35 +02:00
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:
parent
c0e2ed86c1
commit
72f39bf20c
41 changed files with 1847 additions and 189 deletions
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue