code wiki / _hdl_build / _lintext_fixture_bad.nx
_lintext_fixture_bad.nx source
↩ module page · 21 lines · 843 B
1// _lintext_fixture_bad.nx -- NEG-CONTROL FIXTURE for nx_lang_lint_ext. Deliberately carries exactly the two
2// landmines that cost build cycles on 2026-07-25/26, so a GREEN run of the linter on real code means the
3// linter is working rather than merely silent. If this file ever lints CLEAN, the detector is broken.
4// * FX_MISSING is used below and declared NOWHERE (the seq1012 shape).
5// * FX_EMPTY is spelled "\x00" -- a zero-length literal wearing an escape (the seq907 shape L2 misses).
6// NOT BUILT as part of anything: it exists to be linted. license_tier: ORIGINAL
7import "nx_syscalls.nx"
8
9const FX_EMPTY: *u8 = "\x00"
10const FX_REAL: i64 = 7
11
12func fx_use() -> i64 {
13 let a: i64 = FX_REAL
14 let b: i64 = FX_MISSING
15 return a + b
16}
17func main() -> i64 {
18 sys_write(1, FX_EMPTY, 0)
19 sys_exit(fx_use())
20 return 0
21}