You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
serde: integers past i32 deserialize as floats on 32-bit targets #753
With Luau on a 32-bit target, Integer is i32, so a whole number past that range comes back as Value::Number, and from_value hands it to serde as an f64. Deserializing it into an integer type then fails:
let value:Value = lua.load("return 3000000000").eval()?;
lua.from_value::<u64>(value)// i686: Err(invalid type: floating point `3000000000.0`, expected u64)
On 64-bit that's Ok(3000000000). I think the integer hints (deserialize_u64 and friends) could visit an integral Value::Number as an integer instead of forwarding to deserialize_any, so 64-bit wouldn't change. We hit this in maki's provider plugins on i686. Would you take a PR for this?
Activity