Files
hakorune/examples/aot_py_result_err.hako

17 lines
412 B
Plaintext
Raw Normal View History

// AOT Python evalR Err demo (returns Result.Err)
// Build:
// cargo build --release --features cranelift-jit
// ./target/release/nyash --compile-native examples/aot_py_result_err.hako -o app && ./app
static box Main {
main() {
local py, r
py = new PyRuntimeBox()
// Division by zero triggers a Python exception → Err(...)
r = py.evalR(1/0)
me.console.println(r)
return 0
}
}