Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8259437 | 17 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b05 |
JDK-8260117 | 16.0.1 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b03 |
Description
This code is being rejected by javac but should be accepted:
class SealedExample
{
// Compiles if you remove `sealed` or if `I` is not generic.
sealed interface I<T> {
final class C implements I<Object> { }
}
static void f(final I<Object> x) {
if (x instanceof I.C) {
}
}
}
class SealedExample
{
// Compiles if you remove `sealed` or if `I` is not generic.
sealed interface I<T> {
final class C implements I<Object> { }
}
static void f(final I<Object> x) {
if (x instanceof I.C) {
}
}
}
Attachments
Issue Links
- backported by
-
JDK-8259437 unexpected compilation error with generic sealed interface
- Resolved
-
JDK-8260117 unexpected compilation error with generic sealed interface
- Resolved