private static OperatorInfo[] _infos = MakeOperatorTable(); // table of Operators, names, and alt names for looking up methods. public DoOperationBinderHelper(CodeContext context, DoOperationAction action, object[] args) : base(context, action) { _args = args; _types = CompilerHelpers.GetTypes(args); _rule.MakeTest(_types); }
private object CallFailed(CodeContext context, List <MethodCandidate> targets, CallType callType, object[] args) { if (_binder.IsBinaryOperator) { return(context.LanguageContext.GetNotImplemented(targets.ToArray())); } if (targets.Count == 0) { throw NoApplicableTarget(callType, CompilerHelpers.GetTypes(args)); } else { throw MultipleTargets(targets, callType, CompilerHelpers.GetTypes(args)); } }
public bool CheckArgs(CodeContext context, object[] args, SymbolId[] names) { Type [] newArgs; if (!TryGetNormalizedArguments(CompilerHelpers.GetTypes(args), names, out newArgs)) { return(false); } if (IsApplicable(newArgs, NarrowingLevel.None)) { return(true); } object [] objArgs; TryGetNormalizedArguments(args, names, out objArgs); return(Target.CheckArgs(context, objArgs)); }
private List <MethodCandidate> FindTarget(CallType callType, object[] args, SymbolId[] names) { return(SelectTargets(callType, CompilerHelpers.GetTypes(args), names)); }