TypeDfaState (TypeDfaState state, ArgumentsInstruction instruction, int descriptorId, Collection<Argument> arguments) { return updateVariableType(state, instruction, descriptorId, () -> { DFAType result = state.getNotNullDFAType(descriptorId); final GroovyResolveResult[] results = instruction.getElement().multiResolve(false); for (GroovyResolveResult variant : results) { if (!(variant instanceof GroovyMethodResult)) continue; GroovyMethodCandidate candidate = ((GroovyMethodResult)variant).getCandidate(); if (candidate == null) continue; ArgumentMapping<PsiCallParameter> mapping = candidate.getArgumentMapping(); if (mapping == null) continue; for (Argument argument : arguments) { PsiType parameterType = mapping.expectedType(argument); if (parameterType == null) continue; PsiType typeToMixin = variant.getSubstitutor().substitute(parameterType); result = result.withNewMixin(typeToMixin, null); } } return result; }); }