public OverloadableOperation(Operator op, params Operand[] operands) { this.op = op; this.operands = operands; List<ApplicableFunction> candidates = null; foreach (Operand operand in operands) { if ((object)operand != null && !operand.Type.IsPrimitive) { // try overloads candidates = op.FindUserCandidates(operands); break; } } if (candidates == null) candidates = OverloadResolver.FindApplicable(op.GetStandardCandidates(operands), operands); if (candidates == null) throw new InvalidOperationException(string.Format(null, Properties.Messages.ErrInvalidOperation, op.methodName, string.Join(", ", Array.ConvertAll<Operand, string>(operands, Operand.GetTypeName)))); af = OverloadResolver.FindBest(candidates); if (af == null) throw new AmbiguousMatchException(Properties.Messages.ErrAmbiguousBinding); }
void PrepareAf(ITypeMapper typeMapper) { if (_af != null) { return; } List <ApplicableFunction> candidates = null; foreach (Operand operand in _operands) { if ((object)operand != null && !operand.GetReturnType(typeMapper).IsPrimitive) { // try overloads candidates = _op.FindUserCandidates(typeMapper, _operands); break; } } if (candidates == null) { candidates = OverloadResolver.FindApplicable(_op.GetStandardCandidates(typeMapper, _operands), typeMapper, _operands); } if (candidates == null) { throw new InvalidOperationException(string.Format(null, Messages.ErrInvalidOperation, _op.MethodName, string.Join(", ", Array.ConvertAll <Operand, string>(_operands, op => op.GetReturnType(typeMapper).FullName)))); } _af = OverloadResolver.FindBest(candidates, typeMapper); if (_af == null) { throw new AmbiguousMatchException(Messages.ErrAmbiguousBinding); } }
public Property(ApplicableFunction property, Operand target, Operand[] indexes) { this.property = property; this.target = target; this.indexes = indexes; }
public NewObject(ApplicableFunction ctor, Operand[] args) { this.ctor = ctor; this.args = args; }
public NewObject(ApplicableFunction ctor, Operand[] args) { _ctor = ctor; _args = args; }
public Invocation(ApplicableFunction method, Operand target, Operand[] args) { this.method = method; this.target = target; this.args = args; }
public Invocation(ApplicableFunction method, Operand target, Operand[] args) { _method = method; _target = target; _args = args; }
public Property(ApplicableFunction property, Operand target, Operand[] indexes) { _property = property; _target = target; _indexes = indexes; }