Ejemplo n.º 1
0
        protected List <Exp> AnalyArgLambda(ZLParamInfo[] defArgs, List <Exp> expArgs)
        {
            if (defArgs.Length != expArgs.Count)
            {
                throw new CCException();
            }
            List <Exp> newExpArgs = new List <Exp>();
            int        size       = defArgs.Length;

            for (int i = 0; i < size; i++)
            {
                var defArg = defArgs[i];
                var expArg = expArgs[i];
                if (defArg.GetIsGenericParam() == false && ZTypeUtil.IsFn(defArg.ZParamType))
                {
                    throw new CCException("参数不能同时是泛型参数和lambda参数");
                }
                if (defArg.GetIsGenericParam() == false)
                {
                    newExpArgs.Add(expArg);
                }
                else if (ZTypeUtil.IsFn(defArg.ZParamType))
                {
                    ExpNewLambda newLambdaExp = new ExpNewLambda(this.ExpContext, expArg, defArg.ZParamType);
                    //newLambdaExp.SetContextExp(this.ExpContext);
                    Exp exp2 = newLambdaExp.Analy();
                    newExpArgs.Add(exp2);
                }
                else
                {
                    newExpArgs.Add(expArg);
                }
            }
            return(newExpArgs);
        }
Ejemplo n.º 2
0
 protected void AnalyArgLambda()
 {
     if (!ToExp.AnalyCorrect)
     {
         return;
     }
     if (ToExp.RetType == null)
     {
         return;
     }
     if (ZTypeUtil.IsFn(ToExp.RetType))
     {
         ExpNewLambda newLambdaExp = new ExpNewLambda(this.ExpContext, ValueExp, ToExp.RetType);
         //newLambdaExp.SetContext(this.ExpContext);
         Exp exp2 = newLambdaExp.Analy();
         NewValueExp = exp2;
     }
     else
     {
         NewValueExp = ValueExp;
     }
 }