the code below should be accepted according to the current text of JEP 401, in particular where it reads:
...
For convenience, fields that have been assigned may be read by subsequent early construction code (that is, early construction may freely access the fields of this, but may not invoke instance methods
...
value class V1 {
int x;
int y;
V1() {
x = 34;
y = x;
}
}
javac is currently rejecting it
...
For convenience, fields that have been assigned may be read by subsequent early construction code (that is, early construction may freely access the fields of this, but may not invoke instance methods
...
value class V1 {
int x;
int y;
V1() {
x = 34;
y = x;
}
}
javac is currently rejecting it