record Rec(int x, String s) { void foo(Object o) { switch (o) { case Rec(int patternX, String s) -> {} } } }