GetExplicit() public static method

public static GetExplicit ( Operand op, Type to, bool onlyStandard, ITypeMapper typeMapper ) : Conversion
op Operand
to IKVM.Reflection.Type
onlyStandard bool
typeMapper ITypeMapper
return Conversion
コード例 #1
0
        protected internal void EmitGetHelper(Operand op, Type desiredType, bool allowExplicitConversion)
        {
            if (desiredType.IsByRef)
            {
                EmitGetHelper_Ref(op, desiredType);
                return;
            }

            if ((object)op == null)
            {
                if (desiredType.IsValueType)
                {
                    throw new ArgumentNullException(nameof(op));
                }
                IL.Emit(OpCodes.Ldnull);
                return;
            }

            EmitGetHelper_Conversion(op, desiredType, allowExplicitConversion ? Conversion.GetExplicit(op, desiredType, false, TypeMapper) : Conversion.GetImplicit(op, desiredType, false, TypeMapper));
        }
コード例 #2
0
        internal void Convert(Operand op, Type to, bool allowExplicit)
        {
            Conversion conv = allowExplicit ? Conversion.GetExplicit(op, to, false) : Conversion.GetImplicit(op, to, false);

            conv.Emit(this, (object)op == null ? null : op.Type, to);
        }