Restore support for local class literals in annotation arguments
This was broken in c1ab08c8ce where we started to represent KClassValue
as a ClassId of the referenced class + number of times it's been wrapped
into kotlin.Array. Local classes do not have a sane ClassId, so in this
change we restore the old behavior by representing KClassValue with a
sealed class value instead
#KT-29891 Fixed
This commit is contained in:
+3
-2
@@ -190,8 +190,9 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
|
||||
if (descriptor?.fqName == USE_EXPERIMENTAL_FQ_NAME) {
|
||||
val annotationClasses = descriptor.allValueArguments[USE_EXPERIMENTAL_ANNOTATION_CLASS]
|
||||
annotationClasses is ArrayValue && annotationClasses.value.any { annotationClass ->
|
||||
annotationClass is KClassValue && annotationClass.value.let { (classId, arrayDimensions) ->
|
||||
classId.asSingleFqName() == annotationFqName && arrayDimensions == 0
|
||||
annotationClass is KClassValue && annotationClass.value.let { value ->
|
||||
value is KClassValue.Value.NormalClass &&
|
||||
value.classId.asSingleFqName() == annotationFqName && value.arrayDimensions == 0
|
||||
}
|
||||
}
|
||||
} else false
|
||||
|
||||
Reference in New Issue
Block a user