Open iskiselev opened 9 years ago
Yup, FromNumber should probably interpret -2147483648 as a 32 bit int, take the bits from that and treat it as a 32 bit uint.
See conv_u8: https://github.com/markusjohnsson/cil.js/blob/master/CilJs/Runtime/Runtime.js#L363
JSIL translated code fails on next test case:
It fails with
Error: cannot construct UInt64 from negative number
. This code was translated to:So, probably we should allow creation of UInt64 from negative numbers with built-in conversion or fix how JSIL translates it.