ResolveResult (GrExpression expression) { if (isThisOrSuperRef(expression)) return EmptyGroovyResolveResult.INSTANCE; PsiType type = expression.getType(); if (type instanceof PsiClassType) { return ((PsiClassType)type).resolveGenerics(); } if (type == null && expression instanceof GrReferenceExpression) { GroovyResolveResult resolveResult = ((GrReferenceExpression)expression).advancedResolve(); if (resolveResult.getElement() instanceof PsiClass) { return resolveResult; } } return EmptyGroovyResolveResult.INSTANCE; }