code wiki / (root) / nx_macro_argcap_probe.nx

nx_macro_argcap_probe.nx

buildroot/runtime/nx_macro_argcap_probe.nx

1601 B33 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind probetopic macro
docsdependenciesstructsconstsfunctions

about

nx_macro_argcap_probe.nx -- NEGATIVE CONTROL for the >8-argument macro refusal (debt 1785521154). THIS FILE MUST FAIL TO BUILD. It is not a gate; it is the proof that the tooth BITES. The macro below declares NINE parameters. Before the fix, only the first 8 were registered, so the 9th parameter name `i` was never recognised inside the body -- it fell through to the copy-verbatim branch and was emitted as the LITERAL identifier `i`. Because a variable named `i` IS in scope at the call site, that produced a program which COMPILED AND RAN, returning the wrong value (7, the local i) instead of 9. A silent miscompile with no diagnostic. After the fix, lexm_subst REFUSES the whole expansion, emits nothing, and the macro name survives to the parser -- so the build fails LOUDLY with `undefined function: ARGCAP9`. EXPECTED: BUILD-FAILED with an undefined-function error naming ARGCAP9, plus the nx_tokenizer stderr warning naming the argument count. A SUCCESSFUL BUILD MEANS THE FIX REGRESSED. expect_exit: nonzero-build license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_kernel_v2.nx nx_macro_argcap_probe.nx

imports: nx_kernel_v2.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main argcap_probe

structs

none

consts

none

functions

22func argcap_probe() -> nx_int
called by 1: main
27func main() -> nx_exit
calls 1: argcap_probe