Ejemplo n.º 1
0
            private AggCastResult bindExplicitConversionFromPointerToInt(AggregateType aggTypeDest)
            {
                // 27.4 Pointer conversions
                // in an unsafe context, the set of available explicit conversions (13.2) is extended to include
                // the following explicit pointer conversions:
                //
                // * From any pointer-type to sbyte, byte, short, ushort, int, uint, long, or ulong.

                if (!(_typeSrc is PointerType) || aggTypeDest.fundType() > FUNDTYPE.FT_LASTINTEGRAL || !aggTypeDest.isNumericType())
                {
                    return(AggCastResult.Failure);
                }
                if (_needsExprDest)
                {
                    _binder.bindSimpleCast(_exprSrc, _exprTypeDest, out _exprDest);
                }
                return(AggCastResult.Success);
            }
Ejemplo n.º 2
0
            private AggCastResult bindExplicitConversionFromPointerToInt(AggregateType aggTypeDest)
            {
                // 27.4 Pointer conversions
                // in an unsafe context, the set of available explicit conversions (13.2) is extended to include
                // the following explicit pointer conversions:
                //
                // * From any pointer-type to sbyte, byte, short, ushort, int, uint, long, or ulong.

                if (!_typeSrc.IsPointerType() || aggTypeDest.fundType() > FUNDTYPE.FT_LASTINTEGRAL || !aggTypeDest.isNumericType())
                {
                    return AggCastResult.Failure;
                }
                if (_needsExprDest)
                    _binder.bindSimpleCast(_exprSrc, _exprTypeDest, out _exprDest);
                return AggCastResult.Success;
            }