diff options
Diffstat (limited to 'tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK2.java')
-rw-r--r-- | tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK2.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK2.java b/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK2.java new file mode 100644 index 000000000..8f80aad90 --- /dev/null +++ b/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK2.java @@ -0,0 +1,10 @@ +public class RecordPatternsPreview1ExhaustivenessOK2 { + public static void main(String[] args) { + Person person = new Person("Bob", 12); + switch (person) { + case Person(var name, var age) -> System.out.println(name + " " + age); + } + } +} + +record Person(String name, int age) { } |