Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting/RecursiveConstructorInvocation.java
Bas Leijdekkers 291bb89726 Java:Highlight "Recursive constructor invocation" error on the constructor call (IDEA-356563)
GitOrigin-RevId: ec04cb0aa5b234ea9814d78400c83fa70e6bd29b
2024-07-19 20:23:55 +00:00

45 lines
719 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="Variable 'value' might already have been assigned to">value</error> = 1;
}
}