PsiType (@NotNull GrMethodCall callExpression) { PsiMethod method = callExpression.resolveMethod(); if (method == null) return null; for (GroovyMethodInfo methodInfo : GroovyMethodInfo.getInfos(method)) { String returnType = methodInfo.getReturnType(); if (returnType != null) { if (methodInfo.isApplicable(method)) { return JavaPsiFacade.getElementFactory(callExpression.getProject()).createTypeFromText(returnType, callExpression); } } else { if (methodInfo.isReturnTypeCalculatorDefined()) { if (methodInfo.isApplicable(method)) { PsiType result = methodInfo.getReturnTypeCalculator().fun(callExpression, method); if (result != null) { return result; } } } } } return null; }