code wiki / _hdl_build / nx_probe_dym_type_live.nx
nx_probe_dym_type_live.nx source
↩ module page · 19 lines · 904 B
1// nx_probe_dym_type_live.nx -- LIVE WITNESS for TYPE-NAME DID-YOU-MEAN (2026-08-05).
2// A misspelled struct type must be refused with the nearest declared type name.
3// REPRO: change `*TypoPoint` in the let annotation to `*TypoPont` and /api/build ->
4// nx_parse: unknown type name 'TypoPont' (not a primitive, struct, or registered type
5// alias) -- did you mean 'TypoPoint'? (then:
6// note: 'TypoPoint' is declared at line M: (the declaration ITSELF is quoted -- v2 bar)
7// struct TypoPoint { x: i64, y: i64 }
8// then: nx_parse: 1 error(s) -- no output emitted)
9// Kept VALID in-tree (compiler-root probe convention).
10// license_tier: ORIGINAL expect_exit: 0
11import "nx_syscalls.nx"
12struct TypoPoint { x: i64, y: i64 }
13func main(argc: i64, argv: *i64) -> i64 {
14 let p_raw: *u8 = sys_mmap(16)
15 let p: *TypoPoint = p_raw as *TypoPoint
16 p.x = 41
17 sys_exit(0)
18 return 0
19}