code wiki / (root) / nx_probe_caplim_fmem.nx

nx_probe_caplim_fmem.nx source

↩ module page · 15 lines · 574 B

1// nx_probe_caplim_fmem.nx -- MUST-REFUSE WITNESS (float boundary, MEMORY sites, 2026-08-13): 2// deref-assign (*p = 1.5), array subscript (a[i] = 1.5), and struct field (s.f = 1.5) all used 3// to bit-store silently. All three must refuse via the SHARED guard with dst = pointee/element/ 4// field type. EXPECT: COMPILE-FAIL, 3 error(s), 3 capability=float-int-boundary slugs. 5struct FmS { f: i64, g: i64 } 6func main(argc: i64, argv: *u8) -> i64 { 7 var a: [4]i64 8 var s: FmS 9 var box: i64 = 0 10 var p: *i64 = (&box) as *i64 11 *p = 1.5 12 a[1] = 2.5 13 s.f = 3.5 14 return 0 15}