PsiType (@NotNull PsiParameter parameter) { if (!(parameter instanceof GrParameter)) { PsiElement scope = parameter.getDeclarationScope(); if (scope instanceof GrAccessorMethod) { return getVarType(((GrAccessorMethod)scope).getProperty()); } return parameter.getType(); } PsiElement parent = parameter.getParent(); if (!(parent instanceof GrParameterList)) { return getVariableTypeInner(parameter); } PsiElement pparent = parent.getParent(); if (!(pparent instanceof GrMethod)) return parameter.getType(); PsiType[] types = inferMethodParameters((GrMethod)pparent); return types[((GrParameterList)parent).getParameterNumber((GrParameter)parameter)]; }