mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-16 00:14:33 +07:00
Error highlighting for records: check that fields are initialized in canonical constructor (8.10.4) IDEA-228460
GitOrigin-RevId: 6b1cc0b27cc34a6b1f975316a667d606d6dd6a7b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
811b8fca50
commit
f29de7206f
+9
@@ -18,6 +18,7 @@ record TypeMismatch<T>(T t) {
|
||||
record Delegate(int x) {
|
||||
public Delegate(int x) {
|
||||
<error descr="Canonical constructor cannot delegate to another constructor">this()</error>;
|
||||
this.x = 0;
|
||||
}
|
||||
|
||||
public <error descr="Non-canonical record constructor must delegate to another constructor">Delegate</error>() {
|
||||
@@ -26,4 +27,12 @@ record Delegate(int x) {
|
||||
public <error descr="Non-canonical record constructor must delegate to another constructor">Delegate</error>(int x, int y) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
record NotInitializedField(int <error descr="Record component 'x' might not be initialized in canonical constructor">x</error>,
|
||||
int <error descr="Record component 'y' might not be initialized in canonical constructor">y</error>,
|
||||
int z) {
|
||||
public NotInitializedField(int x, int y, int z) {
|
||||
if (Math.random() > 0.5) this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user