rescript-core
rescript-core copied to clipboard
Difference in limit for Int in Int.fromString and Belt.Int.fromString
Can see that there was no specific min and max limit check in Belt.Int.fromString but in Rescript core Int.fromString maybeInt > 2147483647 || maybeInt < -2147483648 check is added. Why exactly this limitation was added as this is affecting previous behaviour
?
Switching from Belt.Int.toString() to Int.toString() is not seamless here since Belt did not check for these bounds.
Int in ReScript is meant to be 32 bits, so Belt.Int.fromString is unsafe compared to RescriptCore.Int.fromString because it doesn't check for that. If something has to be corrected, it is in Belt. Don't hesitate to open a PR for this in rescript main repo.