Details
-
Bug
-
Resolution: Fixed
-
P1
-
14
-
b34
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8236037 | 15 | Vicente Arturo Romero Zaldivar | P2 | Resolved | Fixed | b02 |
JDK-8238034 | 14.0.2 | Vicente Arturo Romero Zaldivar | P1 | Resolved | Fixed | b01 |
JDK-8238047 | 14.0.1 | Vicente Arturo Romero Zaldivar | P1 | Resolved | Fixed | b02 |
Description
The below code declares a record in a local class. It should throw a compilation error as nested record type is implicitly static and inner class cannot have static members except for constant variables. However, the compilation goes through successfully.
class Outer {
public void test() {
class Inner extends Outer {
record TestRecord(int i, int j) {
}
}
}
}
class Outer {
public void test() {
class Inner extends Outer {
record TestRecord(int i, int j) {
}
}
}
}
Attachments
Issue Links
- backported by
-
JDK-8238034 No compilation error reported when a record is declared in a local class
-
- Resolved
-
-
JDK-8238047 No compilation error reported when a record is declared in a local class
-
- Resolved
-
-
JDK-8236037 No compilation error reported when a record is declared in a local class
-
- Resolved
-
- links to
-
Commit openjdk/panama-foreign/c2e69df5