Rubberduck.Parsing.Preprocessing.UnaryNotExpression.Evaluate C# (CSharp) Method

Evaluate() public method

public Evaluate ( ) : IValue
return IValue
        public override IValue Evaluate()
        {
            var operand = _expression.Evaluate();
            if (operand == null)
            {
                return null;
            }
            else if (operand.ValueType == ValueType.Bool)
            {
                return new BoolValue(!operand.AsBool);
            }
            else
            {
                var coerced = operand.AsDecimal;
                return new DecimalValue(~Convert.ToInt64(coerced));
            }
        }
    }