79eee6de4f
Java annotation interface fields are constant declarations that can have any Java type and are not restricted in the same way that method return types are for annotation interfaces. #KT-65482 Fixed
29 lines
562 B
Kotlin
Vendored
29 lines
562 B
Kotlin
Vendored
// WITH_STDLIB
|
|
// TARGET_BACKEND: JVM
|
|
|
|
// FILE: MyApi.java
|
|
import java.lang.annotation.ElementType;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
import java.lang.annotation.Target;
|
|
|
|
@Retention(RetentionPolicy.CLASS)
|
|
@Target({
|
|
ElementType.FIELD,
|
|
ElementType.METHOD,
|
|
ElementType.TYPE,
|
|
ElementType.CONSTRUCTOR,
|
|
ElementType.PACKAGE
|
|
})
|
|
public @interface MyApi {
|
|
Integer LATEST = -1;
|
|
long value();
|
|
}
|
|
|
|
// FILE: main.kt
|
|
|
|
fun box(): String {
|
|
if (-1 == MyApi.LATEST) return "OK"
|
|
return "NOT OK"
|
|
}
|