Beispiel #1
0
        /// <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="object">The <see cref="Object" /> property of the result.</param>
        /// <param name="arguments">The <see cref="Arguments" /> property of the result.</param>
        /// <returns>This expression if no children changed, or an expression with the updated children.</returns>
        public GetMemberDynamicCSharpExpression Update(Expression @object, IEnumerable <DynamicCSharpArgument> arguments)
        {
            if (@object == Object && SameElements(ref arguments, Arguments))
            {
                return(this);
            }

            return(DynamicCSharpExpression.DynamicGetMember(@object, Name, arguments, Flags, Context));
        }
Beispiel #2
0
 internal override Expression ReduceIsCompleted(Expression awaiter)
 {
     return
         (DynamicCSharpExpression.DynamicConvert(
              DynamicCSharpExpression.DynamicGetMember(
                  awaiter,
                  "IsCompleted",
                  Array.Empty <DynamicCSharpArgument>(),
                  CSharpBinderFlags.None,
                  Context
                  ),
              typeof(bool),
              CSharpBinderFlags.ConvertExplicit,
              Context
              ));
 }