PsiType (@NotNull PsiParameter parameter) { final PsiElement scope = parameter.getDeclarationScope(); final PsiType type; if (scope instanceof GrClosableBlock) { type = ClosureParameterEnhancer.inferType((GrClosableBlock)scope, ((GrParameterList)parameter.getParent()).getParameterIndex(parameter)); } else { type = null; } return type; }