Exemplo n.º 1
0
        public virtual Expression CreateExpressionTree(ResolveContext ec)
        {
            if (ArgType == AType.Default)
            {
                ec.Report.Error(854, Expr.Location, "An expression tree cannot contain an invocation which uses optional parameter");
            }

            return(Expr.CreateExpressionTree(ec));
        }
Exemplo n.º 2
0
        public virtual Expression CreateExpressionTree(ResolveContext rc)
        {
            if (Type.Kind == MemberKind.ByRef)
            {
                rc.Report.Error(8153, Expr.Location, "An expression tree lambda cannot contain a call to a method, property, or indexer that returns by reference");
                return(null);
            }

            if (ArgType == AType.Default)
            {
                rc.Report.Error(854, Expr.Location, "An expression tree cannot contain an invocation which uses optional parameter");
            }

            return(Expr.CreateExpressionTree(rc));
        }
Exemplo n.º 3
0
        public override Expression CreateExpressionTree(EmitContext ec)
        {
            ArrayList args;

            if (Arguments == null)
            {
                args = new ArrayList(1);
            }
            else
            {
                args = new ArrayList(Arguments.Count + 1);
            }

            args.Add(new Argument(InstanceExpr.CreateExpressionTree(ec)));
            if (Arguments != null)
            {
                foreach (Argument a in Arguments)
                {
                    args.Add(new Argument(a.Expr.CreateExpressionTree(ec)));
                }
            }

            return(CreateExpressionFactoryCall("Invoke", args));
        }
Exemplo n.º 4
0
 public override Expression CreateExpressionTree(ResolveContext ec)
 {
     return(newExpr.CreateExpressionTree(ec));
 }
Exemplo n.º 5
0
 public override Expression CreateExpressionTree(ResolveContext ec)
 {
     return(condition.CreateExpressionTree(ec));
 }