From 7e57bcc1818a402ad6ec32416af2b4522671f9ab Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 29 Mar 2016 11:02:34 +1000 Subject: Java types and type parameters can be annotated since JSR 308 --- test/files/pos/java-type-annotations/NotNull.java | 6 ++++++ test/files/pos/java-type-annotations/Test.java | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 test/files/pos/java-type-annotations/NotNull.java create mode 100644 test/files/pos/java-type-annotations/Test.java (limited to 'test/files/pos') diff --git a/test/files/pos/java-type-annotations/NotNull.java b/test/files/pos/java-type-annotations/NotNull.java new file mode 100644 index 0000000000..2716fe1a99 --- /dev/null +++ b/test/files/pos/java-type-annotations/NotNull.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +public @interface NotNull { +} diff --git a/test/files/pos/java-type-annotations/Test.java b/test/files/pos/java-type-annotations/Test.java new file mode 100644 index 0000000000..d6bda1dedb --- /dev/null +++ b/test/files/pos/java-type-annotations/Test.java @@ -0,0 +1,4 @@ +public class Test { + static class C<@NotNull T> {}; + @NotNull String foo() { return ""; } +} -- cgit v1.2.3