Exemple #1
0
        /// <summary>
        /// Get TypeFlags of the reduced type of a type.
        /// The reduced type concept is described in ECMA 335 chapter I.8.7
        /// </summary>
        private static TypeFlags GetReducedTypeElementType(TypeDesc type)
        {
            TypeFlags elemType = type.GetTypeFlags(TypeFlags.CategoryMask);

            switch (elemType)
            {
            case TypeFlags.Byte:
                return(TypeFlags.SByte);

            case TypeFlags.UInt16:
                return(TypeFlags.Int16);

            case TypeFlags.UInt32:
                return(TypeFlags.Int32);

            case TypeFlags.UInt64:
                return(TypeFlags.Int64);

            case TypeFlags.UIntPtr:
                return(TypeFlags.IntPtr);
            }

            return(elemType);
        }