aboutsummaryrefslogtreecommitdiff
path: root/javatests
diff options
context:
space:
mode:
authorLiam Miller-Cushon <cushon@google.com>2021-03-02 17:33:27 -0800
committerJavac Team <javac-team+copybara@google.com>2021-03-02 17:33:58 -0800
commit617a8f61b47d31f710386331b4380ba3c9c93872 (patch)
tree0ff28b16c687c087110af674deb2a4a9f0f66c98 /javatests
parentaabe1f4166b54f2826b08d93f396ac1a9ec16e8e (diff)
downloadturbine-617a8f61b47d31f710386331b4380ba3c9c93872.tar.gz
Don't read `<clinit>`s from class files
This was causing an error when checking required annotation elements for annotations with `<clinit>`s read from bytecode: ``` error: missing required annotation argument: <clinit> @Foo ``` https://github.com/bazelbuild/bazel/issues/13144 PiperOrigin-RevId: 360553027
Diffstat (limited to 'javatests')
-rw-r--r--javatests/com/google/turbine/lower/LowerIntegrationTest.java1
-rw-r--r--javatests/com/google/turbine/lower/testdata/annotation_clinit.test18
2 files changed, 19 insertions, 0 deletions
diff --git a/javatests/com/google/turbine/lower/LowerIntegrationTest.java b/javatests/com/google/turbine/lower/LowerIntegrationTest.java
index 85c3450..0bc883d 100644
--- a/javatests/com/google/turbine/lower/LowerIntegrationTest.java
+++ b/javatests/com/google/turbine/lower/LowerIntegrationTest.java
@@ -180,6 +180,7 @@ public class LowerIntegrationTest {
"field_anno.test",
"annotation_bool_default.test",
"annotation_class_default.test",
+ "annotation_clinit.test",
"annotation_declaration.test",
"annotation_enum_default.test",
"annotations_default.test",
diff --git a/javatests/com/google/turbine/lower/testdata/annotation_clinit.test b/javatests/com/google/turbine/lower/testdata/annotation_clinit.test
new file mode 100644
index 0000000..7419ed6
--- /dev/null
+++ b/javatests/com/google/turbine/lower/testdata/annotation_clinit.test
@@ -0,0 +1,18 @@
+%%% pkg/Anno.java %%%
+package pkg;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Anno {
+ String CONSTANT = Anno.class.toString();
+
+ String value() default "";
+}
+
+=== pkg/T.java ===
+package pkg;
+
+@Anno
+class T {}