mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
[incomplete-project-model] Attribute value must be constant: do not report on pending refs
GitOrigin-RevId: 3ea9a300b731280c6778ebcee2c858ab8b3e6534
This commit is contained in:
committed by
intellij-monorepo-bot
parent
49a5baff95
commit
2e03408f96
@@ -352,6 +352,10 @@ public final class AnnotationsHighlightUtil {
|
||||
PsiElement parent = expression.getParent();
|
||||
if (PsiUtil.isAnnotationMethod(parent) || parent instanceof PsiNameValuePair || parent instanceof PsiArrayInitializerMemberValue) {
|
||||
if (!PsiUtil.isConstantExpression(expression)) {
|
||||
if (IncompleteModelUtil.isIncompleteModel(expression) &&
|
||||
IncompleteModelUtil.mayHaveUnknownTypeDueToPendingReference(expression)) {
|
||||
return null;
|
||||
}
|
||||
String description = JavaErrorBundle.message("annotation.non.constant.attribute.value");
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(description);
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ public class Simple {
|
||||
if (<error descr="Operator '==' cannot be applied to 'char', 'boolean'">c == b</error>) {}
|
||||
}
|
||||
|
||||
@<info descr="Not resolved until the project is fully loaded">Anno</info>(<info descr="Not resolved until the project is fully loaded">Cls</info>.<info descr="Not resolved until the project is fully loaded">CONST</info>)
|
||||
void testAssign(<info descr="Not resolved until the project is fully loaded">Unknown</info> u) {
|
||||
u.<info descr="Not resolved until the project is fully loaded">field</info> = 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user