[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
This commit is contained in:
Mads Ager
2024-02-02 12:11:03 +01:00
committed by Space Team
parent f5d0a5b92d
commit 79eee6de4f
12 changed files with 99 additions and 3 deletions
+28
View File
@@ -0,0 +1,28 @@
// 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"
}