예제 #1
0
        private static bool HasExplicitNumericConversion(KnownType sourceType, KnownType targetType)
        {
            if (sourceType.IsIntrinsicNumericType() && targetType.IsIntrinsicNumericType())
            {
                return(!HasImplicitNumericConversion(sourceType, targetType));
            }

            return(false);
        }
예제 #2
0
        private static bool HasImplicitNumericConversion(KnownType sourceType, KnownType targetType)
        {
            if (sourceType.IsIntrinsicNumericType() && targetType.IsIntrinsicNumericType())
            {
                var sourceIndex = (int)sourceType;
                var targetIndex = (int)targetType;
                return(ImplicitNumericConversions[sourceIndex, targetIndex]);
            }

            return(false);
        }