/// <summary> /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. /// </summary> /// <param name="expression">The <see cref="Expression" /> property of the result.</param> /// <returns>This expression if no children changed, or an expression with the updated children.</returns> public ConvertDynamicCSharpExpression Update(Expression expression) { if (expression == Expression) { return(this); } return(DynamicCSharpExpression.DynamicConvert(expression, Type, Flags, Context)); }
internal override Expression ReduceIsCompleted(Expression awaiter) { return (DynamicCSharpExpression.DynamicConvert( DynamicCSharpExpression.DynamicGetMember( awaiter, "IsCompleted", Array.Empty <DynamicCSharpArgument>(), CSharpBinderFlags.None, Context ), typeof(bool), CSharpBinderFlags.ConvertExplicit, Context )); }