Light-annotations: fix for reading class-literal varargs (KT-29027, IDEA-204252)
This commit is contained in:
committed by
Nicolay Mitropolsky
parent
bcb220b919
commit
ebd6caaa71
@@ -157,9 +157,13 @@ class KtLightAnnotationForSourceEntry(
|
||||
val valueArguments = callEntry.value.arguments
|
||||
val argument = valueArguments.firstOrNull()?.getArgumentExpression() ?: return null
|
||||
|
||||
if (!callEntry.key.type.let { KotlinBuiltIns.isArray(it) }) return null
|
||||
if (!callEntry.key.type.let { KotlinBuiltIns.isArrayOrPrimitiveArray(it) }) return null
|
||||
|
||||
if (argument !is KtStringTemplateExpression && argument !is KtConstantExpression && getAnnotationName(argument) == null) {
|
||||
if (argument !is KtStringTemplateExpression &&
|
||||
argument !is KtConstantExpression &&
|
||||
argument !is KtClassLiteralExpression &&
|
||||
getAnnotationName(argument) == null
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
+6
-2
@@ -159,9 +159,13 @@ class KtLightAnnotationForSourceEntry(
|
||||
val valueArguments = callEntry.value.arguments
|
||||
val argument = valueArguments.firstOrNull()?.getArgumentExpression() ?: return null
|
||||
|
||||
if (!callEntry.key.type.let { KotlinBuiltIns.isArray(it) }) return null
|
||||
if (!callEntry.key.type.let { KotlinBuiltIns.isArrayOrPrimitiveArray(it) }) return null
|
||||
|
||||
if (argument !is KtStringTemplateExpression && argument !is KtConstantExpression && getAnnotationName(argument) == null) {
|
||||
if (argument !is KtStringTemplateExpression &&
|
||||
argument !is KtConstantExpression &&
|
||||
argument !is KtClassLiteralExpression &&
|
||||
getAnnotationName(argument) == null
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user