| JDK 22 |
|---|
| 22 b27Fixed |
|
Relates :
|
This code is failing to compile:
import java.util.*;
import java.util.function.*;
class Test {
public interface X {
Object O = new Object() {
Function<String, String> x(Map<String, String> m) {
// Error: local variables referenced from a lambda expression must be final or effectively final
return s -> m.get(s);
}
};
}
}
reported by Paul Sandoz
|