1
Vote

Bitwise operators don't work with variables

description

Feeding a Dictionary into Script.Execute that contains an expression with bitwise operators ( |, &, <<, >>) causes failure:
expression
"(1|ERRNO_ADC_CAL_MARKER)"
parameters["ERRNO_ADC_CAL_MARKER"]
{16}
    Boolcon: '((Tie.VAL)(parameters["ERRNO_ADC_CAL_MARKER"])).Boolcon' threw an exception of type 'System.InvalidCastException'
    Count: -1
    Decimalcon: 16
    Defined: true
    Doublecon: '((Tie.VAL)(parameters["ERRNO_ADC_CAL_MARKER"])).Doublecon' threw an exception of type 'System.InvalidCastException'
    HostValue: 16
    Intcon: '((Tie.VAL)(parameters["ERRNO_ADC_CAL_MARKER"])).Intcon' threw an exception of type 'System.InvalidCastException'
    IsBool: false
    IsClass: false
    IsDecimal: true
    IsDouble: false
    IsFalse: false
    IsFunction: false
    IsHostType: false
    IsInt: false
    IsList: false
    IsNull: false
    IsReadOnly: false
    IsTrue: false
    ObjectArray: '((Tie.VAL)(parameters["ERRNO_ADC_CAL_MARKER"])).ObjectArray' threw an exception of type 'System.InvalidCastException'
    Size: -1
    Str: '((Tie.VAL)(parameters["ERRNO_ADC_CAL_MARKER"])).Str' threw an exception of type 'System.InvalidCastException'
    ty: decimalcon
    Undefined: false
    Valor: "(decimal)16"
    value: 16
Tie.Script.Execute(expression+";", parameters)
'Tie.Script.Execute(expression+";", parameters)' threw an exception of type 'Tie.RuntimeException'
    base: {"RUNTIME Tie.TieException: invalid operation from 1 | 16\r\n   at Tie.VAL.op_BitwiseOr(VAL v1, VAL v2)\r\n   at Tie.CPU.Run(Int32 breakPoint)\r\n   at Tie.Computer.Run(CPU cpu, Int32 breakPoint) at line:1 col:26 mod:volatile"}
Notice how it correctly evaluates the variable, but still fails to bitwise Or it.

comments