Parse enum arrays correctly
(cherry picked from commit 5f2b5cf)
This commit is contained in:
committed by
Yan Zhulanow
parent
f15f90a719
commit
82160bc86d
+6
-2
@@ -92,8 +92,12 @@ private fun getConstantValue(
|
||||
is PsiArrayInitializerMemberValue -> psiValue.initializers.toList()
|
||||
else -> listOf(psiValue)
|
||||
}
|
||||
|
||||
if (jComponentType.isPrimitive || jComponentType.isAnnotation || jComponentType.canonicalName == JAVA_LANG_STRING) {
|
||||
|
||||
if (jComponentType.isPrimitive
|
||||
|| jComponentType.isAnnotation
|
||||
|| jComponentType.isEnum
|
||||
|| jComponentType.canonicalName == JAVA_LANG_STRING
|
||||
) {
|
||||
val arr = Array.newInstance(jComponentType, arrayValues.size)
|
||||
arrayValues.forEachIndexed { i, componentPsiValue ->
|
||||
val componentValue = getConstantValue(componentPsiValue, returnType.componentType, jComponentType, evaluator)
|
||||
|
||||
Reference in New Issue
Block a user