PsiField (@NotNull PsiClass pageOrModuleClass, @NotNull PsiType objectType, String name, @NotNull GrExpression invokedExpression, @NotNull GrClosableBlock block) { GrLightField field = new GrLightField(pageOrModuleClass, name, objectType, invokedExpression) { @Override @NotNull public PsiType getType() { PsiType type = block.getReturnType(); return type != null ? type : super.getType(); } @Override public PsiType getDeclaredType() { return null; } }; field.getModifierList().addModifier(GrModifierFlags.STATIC_MASK); return field; }