InferenceStep (@NotNull PsiType closure, @Nullable PsiType returnType, PsiTypeParameter[] typeParameters) { PsiType[] parameters = ((PsiClassType)closure).getParameters(); if (parameters.length != 1) return InferenceStep.EMPTY; PsiType[] rightTypes = closure instanceof GrClosureType ? ((GrClosureType)closure).inferParameters() : parameters; return buildStep(new PsiType[]{returnType}, rightTypes, typeParameters); }