Files
b22ffdcf01 [IDEA-372959] Handle captured variables in chained constructor calls in AnonymousToInnerHandler
GitHub PR: https://github.com/JetBrains/intellij-community/pull/3052

#IDEA-372959 fixed

Merge-request: IJ-MR-164104
Merged-by: Bartek Pacia <bartek.pacia@jetbrains.com>
Co-authored-by: Bartek Pacia <bartek.pacia@jetbrains.com>

GitOrigin-RevId: 6de9007dc34a8f09d6880f5c27a6db3db7094016
2025-05-27 08:03:46 +00:00

25 lines
477 B
Java

public class Test {
void test() {
String hello = "Hello World";
new Inner(hello).print();
new Inner(null, hello).print();
}
private static class Inner {
private final String hello;
public Inner(String hello) {
this(null, hello);
}
public Inner(Object x, String hello) {
this.hello = hello;
}
void print() {
System.out.println(hello);
}
}
}