Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/kt65482.kt
T
Mads Ager 79eee6de4f [FIR] Do not enhance nullability for annotation interface field types.
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
2024-02-06 09:45:34 +00:00

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"
}