Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/RecursiveConstructorInvocation.java
Bas Leijdekkers 9acf04f411 Java: get useful "Create constructor" quick-fix on this() call with incorrect arguments (IDEA-381152)
GitOrigin-RevId: a226e4c6d00310a1fed86fe4e26dc872b64efaca
2025-10-25 11:06:32 +00:00

50 lines
849 B
Java

// recusrsive ctr call
class s {
s() {
<error descr="Recursive constructor call">this()</error>;
}
s(int i) {
<error descr="Recursive constructor call">this(2)</error>;
}
}
class c {
c() {
this(2);
}
c(int i) {
<error descr="Recursive constructor call">this(1,1)</error>;
}
c(int i, int k) {
<error descr="Recursive constructor call">this(1)</error>;
}
}
class cv {
cv() {
this(1);
}
cv(int i) {
this(1,2);
}
cv(int i,int j) {}
}
class X {
private final int value;
X() {
<error descr="Recursive constructor call">this()</error>;
<error descr="Cannot assign final field 'value' after chained constructor call">value</error> = 1;
}
}
class Inconceivable {
Inconceivable() {
this<error descr="Expected no arguments but found 1">(1)</error>;
}
}