mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 10:15:53 +00:00
[jdk20] Updates support for record patterns
This commit is contained in:
1 parent
e5c324c615
commit
83c4dcfd52
5 files changed
+59
-9
No files matched your search
@@ -0,0 +1,16 @@
|
||||
// version 19:19
|
||||
record Point(int x, int y) {
|
||||
}
|
||||
record Rectangle(Point upperLeft, Point lowerRight) {
|
||||
}
|
||||
|
||||
public class RecordPattern19 {
|
||||
void recordPattern(Object o) {
|
||||
if (o instanceof Point(int x, int y)) {
|
||||
}
|
||||
if (o instanceof Point(int x, int y) p) {
|
||||
}
|
||||
if (o instanceof Rectangle(Point(var x1, var y1), Point(int x2, int y2))) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user