mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-09 08:09:39 +07:00
[java-highlighting] IDEA-323955 Make for record patterns support available only for Java 20 preview
GitOrigin-RevId: 564b8a7ff3586a032f048bef8fce18f8da3c0fe8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6d5f726bec
commit
ac1a73d5ee
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user