PsiType () { final PsiType declaredType = getDeclaredType(); if (declaredType != null) return declaredType; if (isVarArgs()) { PsiClassType type = TypesUtil.getJavaLangObject(this); return new PsiEllipsisType(type); } PsiElement parent = getParent(); if (parent instanceof GrForInClause) { GrExpression iteratedExpression = ((GrForInClause)parent).getIteratedExpression(); if (iteratedExpression == null) return null; PsiType result = ClosureParameterEnhancer.findTypeForIteration(iteratedExpression, this); if (result != null) { return result; } } else if (parent instanceof GrTraditionalForClause) { return super.getTypeGroovy(); } else if (parent instanceof GrCatchClause) { return TypesUtil.createTypeByFQClassName(CommonClassNames.JAVA_LANG_EXCEPTION, this); } return GrVariableEnhancer.getEnhancedType(this); }