Esempio n. 1
0
        public static void Reduce(bool useInterpreter)
        {
            Expression <Func <X> > l = () => new X {
                Y = { Z = 42, YS = { 2, 3 } }, XS = { 5, 7 }
            };
            MemberInitExpression e = l.Body as MemberInitExpression;

            l = Expression.Lambda <Func <X> >(e.ReduceAndCheck());
            VerifyMemberInit(l, x => x.Y.Z == 42 && x.XS.Sum() == 5 + 7 && x.Y.YS.Sum() == 2 + 3, useInterpreter);
        }