/// <summary> /// Type inference. Try to infer the type arguments from `method', /// which is invoked with the arguments `arguments'. This is used /// when resolving an Invocation or a DelegateInvocation and the user /// did not explicitly specify type arguments. /// </summary> public static int InferTypeArguments (ResolveContext ec, Arguments arguments, ref MethodSpec method) { ATypeInference ti = ATypeInference.CreateInstance (arguments); TypeSpec[] i_args = ti.InferMethodArguments (ec, method); if (i_args == null) return ti.InferenceScore; if (i_args.Length == 0) return 0; method = method.MakeGenericMethod (i_args); return 0; }