PsiType (GrExpression initializer) { if (initializer.getParent() instanceof GrAssignmentExpression && ((GrAssignmentExpression)initializer.getParent()).getRValue() == initializer) { return ((GrAssignmentExpression)initializer.getParent()).getLValue().getNominalType(); } else if (initializer.getParent() instanceof GrVariable) { return ((GrVariable)initializer.getParent()).getDeclaredType(); } else { return null; } }