mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 16:39:37 +07:00
forbid assignment to final variable inside lambda
This commit is contained in:
@@ -142,3 +142,11 @@ class IDEA128196 {
|
||||
new Thread(() -> System.out.println(value));
|
||||
}
|
||||
}
|
||||
|
||||
class FinalAssignmentInInitializer {
|
||||
private final String x;
|
||||
{
|
||||
Runnable r = () -> <error descr="Cannot assign a value to final variable 'x'">x</error> = "";
|
||||
x = "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user