Boo.Lang.Compiler.TypeSystem.CallableResolutionService.CheckVarArgsParameter C# (CSharp) Method

CheckVarArgsParameter() protected method

protected CheckVarArgsParameter ( IParameter parameters, Boo.Lang.Compiler.Ast.ExpressionCollection args ) : bool
parameters IParameter
args Boo.Lang.Compiler.Ast.ExpressionCollection
return bool
        protected virtual bool CheckVarArgsParameter(IParameter[] parameters, ExpressionCollection args)
        {
            int lastIndex = parameters.Length - 1;
            Node lastArg = args[-1];
            if (AstUtil.IsExplodeExpression(lastArg))
            {
                return CalculateArgumentScore(parameters[lastIndex], parameters[lastIndex].Type, lastArg) > 0;
            }

            IType varArgType = parameters[lastIndex].Type.GetElementType();
            for (int i = lastIndex; i < args.Count; ++i)
            {
                int argumentScore = CalculateArgumentScore(parameters[lastIndex], varArgType, args[i]);
                if (argumentScore < 0) return false;
            }
            return true;
        }