[groovy] IDEA-207415 IDEA-122052: Infer @CompileStatic for code within annotations
authorKonstantin Nisht <konstantin.nisht@jetbrains.com>
Mon, 10 Aug 2020 14:42:56 +0000 (17:42 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 13 Aug 2020 00:36:28 +0000 (00:36 +0000)
Due to AST transformations it makes sense to write closures in annotations. @CompileStatic may affect this code.

GitOrigin-RevId: e65fed5dafef1b1efd88473f3b48c0f7b963fcae

plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java

index b3b40982305c837c2ef112e92a07868581a6eec6..8cc9fcd276efb4cc2d93d72b2fdef9ff9a83669e 100644 (file)
@@ -34,7 +34,6 @@ import org.jetbrains.plugins.groovy.lang.psi.api.EmptyGroovyResolveResult;
 import org.jetbrains.plugins.groovy.lang.psi.api.GroovyResolveResult;
 import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap;
 import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifierList;
-import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.annotation.GrAnnotation;
 import org.jetbrains.plugins.groovy.lang.psi.api.signatures.GrSignature;
 import org.jetbrains.plugins.groovy.lang.psi.api.statements.*;
 import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentLabel;
@@ -1205,7 +1204,7 @@ public final class PsiUtil {
   }
 
   public static boolean isCompileStatic(PsiElement e) {
-    PsiMember containingMember = PsiTreeUtil.getParentOfType(e, PsiMember.class, false, GrAnnotation.class);
+    PsiMember containingMember = PsiTreeUtil.getParentOfType(e, PsiMember.class, false);
     return containingMember != null && GroovyPsiManager.getInstance(containingMember.getProject()).isCompileStatic(containingMember);
   }