コード例 #1
0
        public static void NonVoidReturn()
        {
            Expression ret = new AsyncResultExpression(90.Const(), true);

            Equal(typeof(ValueTask <int>), ret.Type);
            ret = ret.Reduce();
            IsAssignableFrom <UnaryExpression>(ret);
            Equal(typeof(ValueTask <int>), ret.Type);
        }
コード例 #2
0
        public static void VoidReturn()
        {
            Expression ret = new AsyncResultExpression(Expression.Block(typeof(void), 42.Const()), false);

            Equal(typeof(Task), ret.Type);
            ret = ret.Reduce();
            IsAssignableFrom <UnaryExpression>(ret);
            Equal(typeof(Task), ret.Type);
        }