-
Bug
-
Resolution: Fixed
-
P3
-
15
-
b19
Currently the spec describes the string `non-sealed` as a reserved keyword. This means that according to the spec the following code should fail to compile:
int test(int non, int sealed) {
return non-sealed;
}
However, this code compiles correctly (with the preview enabled). The spec should be updated with a notion of *contextual keyword* to allow `non-sealed` to be considered a keyword only in the places where needed.
See http://cr.openjdk.java.net/~gbierman/jep397/jep397-20201104/specs/contextual-keywords-jls.html
int test(int non, int sealed) {
return non-sealed;
}
However, this code compiles correctly (with the preview enabled). The spec should be updated with a notion of *contextual keyword* to allow `non-sealed` to be considered a keyword only in the places where needed.
See http://cr.openjdk.java.net/~gbierman/jep397/jep397-20201104/specs/contextual-keywords-jls.html
- relates to
-
JDK-8246776 JLS changes for Sealed Classes (Second Preview)
- Resolved
-
JDK-8244229 [lworld] Need more robust handling of .ref and .val reference in source code
- Closed