Fix tests with annotations: enum constants are now resolved as constants in JavaConstantExpressionEvaluator

This commit is contained in:
Natalia Ukhorskaya
2014-12-10 10:33:05 +03:00
committed by Nikolay Krasko
parent 601a33f772
commit 43249e928c
@@ -26,6 +26,9 @@ abstract class JavaAnnotationArgumentImpl(
class object {
fun create(argument: PsiAnnotationMemberValue, name: Name?): JavaAnnotationArgument {
val value = JavaPsiFacade.getInstance(argument.getProject()).getConstantEvaluationHelper().computeConstantExpression(argument)
if (value is Enum<*>) {
return JavaEnumValueAnnotationArgumentImpl(argument as PsiReferenceExpression, name)
}
if (value != null || argument is PsiLiteralExpression) {
return JavaLiteralAnnotationArgumentImpl(name, value)
}