record Rec(int x, String s) { void foo(Object o) { if (o instanceof Rec(int patternX, String s) r) { } } }