Disable field assignments in record compact constructors

Last piece of IDEA-239088

GitOrigin-RevId: 23c467c6c525d7908922bc2ebd8928205368dff7
This commit is contained in:
Tagir Valeev
2020-06-22 13:26:17 +03:00
committed by intellij-monorepo-bot
parent 3e101e4fcf
commit e027f98d6a
15 changed files with 96 additions and 7 deletions
@@ -0,0 +1,8 @@
record WrittenFields(int x,
int y,
int z) {
public WrittenFields {
<error descr="Cannot assign a value to final variable 'x'">this.x</error> = 0;
if (Math.random() > 0.5) <error descr="Cannot assign a value to final variable 'y'">this.y</error> = 1;
}
}