code wiki / (root) / nx_argmacro_probe.nx

nx_argmacro_probe.nx source

↩ module page · 15 lines · 656 B

1// nx_argmacro_probe.nx -- MINIMAL repro for arg-macro expansion (id 1785514019). 2// nx_macro_test is a large file with a big import closure and NESTED macro use (MAX's body calls SQ), 3// so its failure cannot distinguish "the mechanism is broken" from "the mechanism works but not at scale 4// / not nested". This isolates ONE arg macro, one use, no nesting, tiny closure. 5// exit 0 = arg expansion WORKS. exit 1 = expanded but wrong value. build failure = mechanism dead. 6// license_tier: ORIGINAL expect_exit: 0 7import "nx_syscalls.nx" 8 9@macro SQP(x) (x * x) 10 11func main() -> i64 { 12 let v: i64 = SQP(5) 13 if v == 25 { return 7 } 14 return 1 15}