diff options
author | Liam Miller-Cushon <cushon@google.com> | 2021-03-02 17:33:27 -0800 |
---|---|---|
committer | Javac Team <javac-team+copybara@google.com> | 2021-03-02 17:33:58 -0800 |
commit | 617a8f61b47d31f710386331b4380ba3c9c93872 (patch) | |
tree | 0ff28b16c687c087110af674deb2a4a9f0f66c98 /javatests | |
parent | aabe1f4166b54f2826b08d93f396ac1a9ec16e8e (diff) | |
download | turbine-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.java | 1 | ||||
-rw-r--r-- | javatests/com/google/turbine/lower/testdata/annotation_clinit.test | 18 |
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 {} |