JEP 488: Primitive Types in Patterns, instanceof, and switch (Second Preview)
🧠 What is JEP 488?
🤔 Problem Before JEP 488
record JsonNumber(double d) implements JsonValue {}
Object json = new JsonNumber(30); // OK: int → double
if (json instanceof JsonNumber(int a)) {
// ❌ ERROR before JEP 488
}PrimitiveSwitchDemoLast updated