Support preference of TYPE_USE annotations to enhance over others like METHOD, FIELD and VALUE_PARAMETER to avoid double applying them in case of arrays: @NotNull Integer [] (both to the array element and to the entire array)
^KT-24392 Fixed
This commit is contained in:
+2
-1
@@ -37,6 +37,7 @@ import org.jetbrains.kotlin.ir.util.defaultType
|
||||
import org.jetbrains.kotlin.ir.util.getAnnotation
|
||||
import org.jetbrains.kotlin.ir.util.hasAnnotation
|
||||
import org.jetbrains.kotlin.ir.util.isAnnotationClass
|
||||
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
@@ -191,7 +192,7 @@ private class AdditionalClassAnnotationLowering(private val context: JvmBackendC
|
||||
}
|
||||
|
||||
private fun generateTargetAnnotation(irClass: IrClass) {
|
||||
if (irClass.hasAnnotation(FqName("java.lang.annotation.Target"))) return
|
||||
if (irClass.hasAnnotation(JvmAnnotationNames.TARGET_ANNOTATION)) return
|
||||
val annotationTargetMap = annotationTargetMaps[jvmTarget]
|
||||
?: throw AssertionError("No annotation target map for JVM target $jvmTarget")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user