implement any & all

This commit is contained in:
2026-05-18 18:24:32 +08:00
parent b420a950a3
commit 9412c319f9
4 changed files with 136 additions and 2 deletions
+2 -2
View File
@@ -258,13 +258,13 @@ impl<'gc> crate::Vm<'gc> {
return Ok(());
}
// TODO: compare other types
Err(crate::vm_err("cannot compare these types"))
Err(crate::vm_err(format!("cannot compare {} with {}", lhs.ty(), rhs.ty())))
}
}
pub(crate) fn get_num(val: StrictValue<'_>) -> Option<NixNum> {
if let Some(i) = val.as_inline::<i32>() {
Some(NixNum::Int(i as i64))
Some(NixNum::Int(i64::from(i)))
} else if let Some(gc_i) = val.as_gc::<i64>() {
Some(NixNum::Int(*gc_i))
} else {