[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:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user