--- a/crates/jrsonnet-stdlib/src/strings.rs +++ b/crates/jrsonnet-stdlib/src/strings.rs @@ -161,7 +161,11 @@ use jrsonnet_evaluator::runtime_error; use Either2::*; Ok(match v { - A(a) => Val::BigInt(Box::new((a as i64).into())), + A(a) => { + Val::BigInt(Box::new(a.to_string().parse().map_err(|e| { + runtime_error!("number is not convertible to bigint: {e}") + })?)) + } B(b) => Val::BigInt(Box::new( b.as_str() .parse()