PsiType (final PsiElement element) { if (element instanceof GrReferenceExpression && ((GrReferenceExpression)element).getQualifierExpression() == null) { return getInitializerTypeFor(element); } if (element instanceof GrVariable) { return ((GrVariable)element).getTypeGroovy(); } return null; }