PsiType () { PsiSubstitutor substitutor = getSubstitutor(); if (myMethod.isConstructor()) { PsiClass clazz = myMethod.getContainingClass(); if (clazz == null) return null; return GroovyPsiElementFactory.getInstance(myMethod.getProject()).createType(clazz, substitutor); } else { return substitutor.substitute(PsiUtil.getSmartReturnType(myMethod)); } }