mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-04 12:17:12 +07:00
Java: statements before super() part I (IDEA-340403)
GitOrigin-RevId: 7307a469267746ed3432acd1e73c894ccc87a254
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7b6abd34f3
commit
176a8e0bec
@@ -11,34 +11,39 @@ class b extends a {
|
||||
}
|
||||
b(int i) {
|
||||
this();
|
||||
<error descr="Call to 'super()' must be first statement in constructor body">super(2)</error>;
|
||||
<error descr="Only one explicit constructor call allowed in constructor">super(2)</error>;
|
||||
}
|
||||
b(char i) {
|
||||
super(4);
|
||||
<error descr="Call to 'this()' must be first statement in constructor body">this()</error>;
|
||||
<error descr="Only one explicit constructor call allowed in constructor">this()</error>;
|
||||
}
|
||||
|
||||
b(String s) {
|
||||
try {
|
||||
<error descr="Call to 'super()' must be first statement in constructor body">super(2)</error>;
|
||||
<error descr="Call to 'super()' must be a top level statement in constructor body">super(2)</error>;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
b(String s, int i) {
|
||||
{
|
||||
<error descr="Call to 'super()' must be first statement in constructor body">super(2)</error>;
|
||||
<error descr="Call to 'super()' must be a top level statement in constructor body">super(2)</error>;
|
||||
}
|
||||
}
|
||||
|
||||
void f() {
|
||||
<error descr="Call to 'super()' must be first statement in constructor body">super()</error>;
|
||||
<error descr="Call to 'super()' only allowed in constructor body">super()</error>;
|
||||
}
|
||||
void g() {
|
||||
<error descr="Call to 'this()' must be first statement in constructor body">this()</error>;
|
||||
<error descr="Call to 'this()' only allowed in constructor body">this()</error>;
|
||||
}
|
||||
|
||||
}
|
||||
class Z {
|
||||
Z() {
|
||||
Object x = <error descr="Call to 'super()' must be a top level statement in constructor body">super()</error>;
|
||||
}
|
||||
}
|
||||
class O extends A.B
|
||||
{
|
||||
public O(A a)
|
||||
|
||||
Reference in New Issue
Block a user