Report errors for annotations with BINARY or RUNTIME retention on file classes.

This commit is contained in:
Dmitry Petrov
2015-09-15 18:49:18 +03:00
parent eba9f0f0ad
commit da026f1480
9 changed files with 129 additions and 5 deletions
@@ -0,0 +1,19 @@
@file:JvmName("MultifileClass")
@file:JvmMultifileClass
<!ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES!>@file:FileAnn<!>
<!ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES!>@file:FileBinaryAnn<!>
@file:FileSourceAnn
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.RUNTIME)
public annotation class FileAnn
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.BINARY)
public annotation class FileBinaryAnn
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.SOURCE)
public annotation class FileSourceAnn
@@ -0,0 +1,40 @@
// FILE: test.kt
@file:JvmName("MultifileClass")
@file:JvmMultifileClass
<!ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES!>@file:JavaAnn<!>
<!ANNOTATION_IS_NOT_APPLICABLE_TO_MULTIFILE_CLASSES!>@file:JavaClassAnn<!>
@file:JavaSourceAnn
// FILE: JavaAnn.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface JavaAnn {
}
// FILE: JavaClassAnn.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
public @interface JavaClassAnn {
}
// FILE: JavaSourceAnn.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.SOURCE)
public @interface JavaSourceAnn {
}