[java-highlighting] IDEA-323955 Make for record patterns support available only for Java 20 preview

GitOrigin-RevId: 564b8a7ff3586a032f048bef8fce18f8da3c0fe8
This commit is contained in:
Mikhail Pyltsin
2023-07-03 11:14:28 +02:00
committed by intellij-monorepo-bot
parent 6d5f726bec
commit ac1a73d5ee
5 changed files with 63 additions and 10 deletions

View File

@@ -0,0 +1,21 @@
import java.util.List;
import java.util.Set;
class Main {
record EmptyBox() {}
record Point(int x, int y) {}
record Rect(Point point1, Point point2) {}
record Pair<T, U>(T t, U u) {}
record Rec(Object obj) {}
Point[] getPoints(int x) {
return new Point[0];
}
void ok1(Point[] points) {
for (<error descr="Record patterns in for-each loops are not supported at language level '21'">Point(int x, int y)</error> : points) {
System.out.println(x + y);
}
}
}