aboutsummaryrefslogtreecommitdiff
path: root/javatests/com/google/turbine/lower/testdata/record.test
diff options
context:
space:
mode:
Diffstat (limited to 'javatests/com/google/turbine/lower/testdata/record.test')
-rw-r--r--javatests/com/google/turbine/lower/testdata/record.test46
1 files changed, 46 insertions, 0 deletions
diff --git a/javatests/com/google/turbine/lower/testdata/record.test b/javatests/com/google/turbine/lower/testdata/record.test
new file mode 100644
index 0000000..7d92c2b
--- /dev/null
+++ b/javatests/com/google/turbine/lower/testdata/record.test
@@ -0,0 +1,46 @@
+=== Records.java ===
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+import java.util.List;
+
+class Records {
+ record R1() {}
+
+ private record R2() {}
+
+ @Deprecated
+ private record R3() {}
+
+ record R4<T>() {}
+
+ record R5<T>(int x) {}
+
+ record R6<T>(@Deprecated int x) {}
+
+ record R7<T>(@Deprecated int x, int... y) {}
+
+ record R8<T>() implements Comparable<R8<T>> {
+ @Override
+ public int compareTo(R8<T> other) {
+ return 0;
+ }
+ }
+
+ record R9(int x) {
+ R9(int x) {
+ this.x = x;
+ }
+ }
+
+ @Target(ElementType.TYPE_USE)
+ @interface A {}
+
+ @Target(ElementType.RECORD_COMPONENT)
+ @interface B {}
+
+ @Target({ElementType.TYPE_USE, ElementType.RECORD_COMPONENT})
+ @interface C {}
+
+ record R10<T>(@A List<@A T> x, @B int y, @C int z) {
+ }
+}