Closed robotii closed 8 years ago
The definition of brokenness is relative here. Comparing a string to a number is not defined. Only comparing a number to an int does auto type-coercion. Without typechecks it just compares the pointer to the value, with typecheck it correctly errors. The second example works as expected.
"3" < 2
returns true"3" number < 2
returns falseI would expect that the results of both would be false
When running with the bytecode interpreter I get an error:
bin/potion -B -I -e '"3" < 2'
\ Invalid type String for reg[op.a], expected NumberIt seems that the comparison is completely broken