Beispiel #1
0
        public void CastSameType(Value other, ValueType minType)
        {
            ValueType targetType = CastArray[(int)Type, (int)other.Type];
            switch (minType)
            {
                case ValueType.Integer:
                    if (targetType == ValueType.Boolean)
                        targetType = ValueType.Integer;
                    break;
                case ValueType.Decimal:
                    if (targetType == ValueType.Boolean || targetType == ValueType.Integer)
                        targetType = ValueType.Decimal;
                    break;
            }

            CastAsType(targetType);
            other.CastAsType(targetType);
            Debug.Assert(Type == other.Type);
        }
Beispiel #2
0
        public void CastSameType(Value other)
        {
            ValueType targetType = CastArray[(int)Type, (int)other.Type];

            CastAsType(targetType);
            other.CastAsType(targetType);
            Debug.Assert(Type == other.Type);
        }