docs: const-aggregate semantics + unchecked-pointer contract (PLAN-CONST-AGG step 6)

This commit is contained in:
agra
2026-06-11 13:54:35 +03:00
parent 40a94c4734
commit c229f697bd
3 changed files with 148 additions and 6 deletions

View File

@@ -5,7 +5,8 @@
> const-flagged global (array consts, #run consts) or a module value
> const (struct consts incl.) — with `cannot assign through constant
> 'X'`. A deref along the chain (`p.*`) breaks the root (pointer writes
> stay the documented escape until the const-ness steps); a local
> are permanently unchecked — the documented pointer contract, specs.md
> §Pointer Types); a local
> shadowing the const name stays writable. Regression test:
> examples/1162-diagnostics-const-write-rejected.sx (struct field — the
> crash repro, array element, compound, bare scalar).