-
Bug
-
Resolution: Fixed
-
P3
-
23
-
b26
-
b03
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8334950 | 23.0.1 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b02 |
JDK-8334504 | 23 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b28 |
This code compiles in with JDK 23 b 26 with disabled preview:
class clss21717_b {
int field1 = 666;
clss21717_b(int arg) {
field1 = arg;
}
}
class clss21717_a extends clss21717_b {
int field2;
clss21717_a() {
super(field2 = 1); //supposed to fall here
}
}
JEP 482 allows such assignment, but JEP 482 is a preview feature. This code should fail in non-preview mode, which it does with JDKb25 but does not with JDKb26.
class clss21717_b {
int field1 = 666;
clss21717_b(int arg) {
field1 = arg;
}
}
class clss21717_a extends clss21717_b {
int field2;
clss21717_a() {
super(field2 = 1); //supposed to fall here
}
}
JEP 482 allows such assignment, but JEP 482 is a preview feature. This code should fail in non-preview mode, which it does with JDKb25 but does not with JDKb26.
- backported by
-
JDK-8334504 Compiler erronousely allows access to instance variable in argument expression of a constructor invocation
- Resolved
-
JDK-8334950 Compiler erronousely allows access to instance variable in argument expression of a constructor invocation
- Resolved
- links to
-
Commit openjdk/jdk/d9dd2d19
-
Commit openjdk/jdk/e227c7e3
-
Review openjdk/jdk/19712
-
Review openjdk/jdk/19784
(1 links to)