In https://bugs.openjdk.org/browse/JDK-8297602 we address a situation of an compiler crash (assertion) with type annotations and generic records during pattern matching, by erasing the annotation and avoiding the crash:
switch(p) {
case Foo<@Annot(field = "") Integer>(): {} // crash
};
if (p instanceof Foo<@Annot(field = "") Integer>()) { // crash
}
A complete treatment with respect to case labels and annotations is tracked under the following specification enhancement:
https://bugs.openjdk.org/browse/JDK-8298150
This bug aims to track the implementation of the proposed spec changes.
switch(p) {
case Foo<@Annot(field = "") Integer>(): {} // crash
};
if (p instanceof Foo<@Annot(field = "") Integer>()) { // crash
}
A complete treatment with respect to case labels and annotations is tracked under the following specification enhancement:
https://bugs.openjdk.org/browse/JDK-8298150
This bug aims to track the implementation of the proposed spec changes.
- relates to
-
JDK-8297602 Compiler crash with type annotation and generic record during pattern matching
-
- Resolved
-
-
JDK-8298150 4.7.20: Realize record patterns as type contexts
-
- Open
-