aboutsummaryrefslogtreecommitdiff
path: root/test/pretty/resource/before/RecordPattern.java
blob: 93c07965e274218e732a3252b5b49999f7ed1920 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// version 19:
record Point(int x, int y) {
}
record Rectangle(Point upperLeft, Point lowerRight) {
}

public class RecordPattern {
	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(int x1, int y1), Point(int x2, int y2))) {
		}
	}
}