Exemplo n.º 1
0
        protected static void EmitChildWithConvert(ExpressionElement child, Type resultType, FleeILGenerator ilg, IServiceProvider services)
        {
            child.Emit(ilg, services);
            bool converted = ImplicitConverter.EmitImplicitConvert(child.ResultType, resultType, ilg);

            Debug.Assert(converted, "convert failed");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Set the left and right operands, get the operation, and get the result type
        /// </summary>
        /// <param name="leftChild"></param>
        /// <param name="rightChild"></param>
        /// <param name="op"></param>
        private void Configure(ExpressionElement leftChild, ExpressionElement rightChild, object op)
        {
            MyLeftChild  = leftChild;
            MyRightChild = rightChild;
            this.GetOperation(op);

            this.ValidateInternal(op);
        }
Exemplo n.º 3
0
        public void SetChild(ExpressionElement child)
        {
            MyChild       = child;
            _myResultType = this.GetResultType(child.ResultType);

            if (_myResultType == null)
            {
                base.ThrowCompileException(CompileErrorResourceKeys.OperationNotDefinedForType, CompileExceptionReason.TypeMismatch, MyChild.ResultType.Name);
            }
        }
Exemplo n.º 4
0
 protected static bool IsChildOfType(ExpressionElement child, Type t)
 {
     return(object.ReferenceEquals(child.ResultType, t));
 }