code wiki / _hdl_build / nx_doc_demo_healed.nx

nx_doc_demo_healed.nx source

↩ module page · 12 lines · 623 B

1// nx_doc_demo_subject.nx -- a DELIBERATELY broken subject for dogfooding the Doctor's autonomous heal on the REAL 2// toolchain (not a synthetic KAT string). It reassigns an immutable `let` binding -> the compiler silently emits an 3// empty .s = the #1 crash this session. nx_doc_autoheal_apply heals it (var acc -> var acc); the healed twin 4// compiles + runs green. This file is EXPECTED to fail to build; that failure is the demo's starting state. 5import "nx_syscalls.nx" 6 7func main() -> i64 { 8 var acc: i64 = 0 9 acc = acc + 42 10 sys_write(1, "nx_doc_demo_subject: ran, acc updated\n" as *u8, 37) 11 return 0 12}