code wiki / (root) / nx_probe_castchain_live.nx

nx_probe_castchain_live.nx source

↩ module page · 13 lines · 650 B

1// nx_probe_castchain_live.nx -- WITNESS (chained casts, 2026-08-13): `X as *u8 as i64` was 2// HALF-APPLIED forever (one cast consumed, the dangler silently junk-skipped; then wrongly 3// REFUSED by the discarded-expression check with a misleading cause at 15 estate sites). 4// Post-fix: the chain is real -- final type = last cast. exit 0 = pointer survived the chain 5// nonzero and both storage shapes work; pre-fix this file REFUSES (dangling-as fragment). 6func main(argc: i64, argv: *u8) -> i64 { 7 let x: i64 = "AB" as *u8 as i64 8 if x == 0 { return 1 } 9 var arr: [2]i64 10 arr[0] = "CD" as *u8 as i64 11 if arr[0] == 0 { return 2 } 12 return 0 13}