Result: done (#962 steps 1-3)
Pushed: see commit
Tests: tests/compiler –both-settings 290 passed 0 failed (3 new: a_read_of_a_list_is_refused_while_a_mutable_view_of_its_element_lives (.stderr), a_let_mut_of_a_struct_field_is_a_view_of_it, a_let_mut_of_a_struct_of_numbers_field_is_a_view_of_it); it: range_spelling shipped_ledger contracts::every_std_module dependency_ledger fmt::every_nika_file selfhosting_defects 42 ok; clippy –all-targets clean
Gate: green
Deviation: new tests not run against an unfixed compiler (shared tree, no old binary kept); the unfixed behaviour is the issue’s: raw rustc E0502 for the read, f.n write lost for the field (my probe printed 1 before the fix, 10 after). lowered/emit_stmt.rs and the lowered.rs export of vc_mut_viewed were already swept into HEAD (2a88c37/5e6602d, another session’s commit) before this commit: HEAD was inconsistent until this push (lowered.rs named vc_mut_viewed, lowered/view_changes.rs lacked it). lower-std ran fine in the shared checkout. lowered.rs has a further uncommitted diff (comptime_tree names, another agent’s), not committed.
Found: the summary line under an NK2305 read still says “1 change to data a view still to be used may point into” (shared wording, a read is not a change). A statement that reads the root before the view’s last use is refused only when the view is named later or in the same statement; a hand-over of the root to a callee that keeps it is not refused (as in #960). Field case: only a field holding a struct of numbers (a_package_copy) becomes a view; Vec/String fields are moves already (NK2105), numbers copy by design.
Needs: supervisor: version raise and CHANGELOG (Part I 6.8 sentence on reads, Part III NK2305 row wording)
Changelog: let mut e = v[i] and let mut f = s.field (a struct of numbers) are mutable views: reading the list or the struct before the view’s last use is NK2305 instead of a rustc error, and a write through f reaches s.
Files: crates/nikaia-std/src/tools/view_changes.nika crates/nikaia-std/src/tools/check_core_stmt.nika crates/nikaia-std/src/tools/emit_stmt.nika crates/nikaia-std/src/tools/lowered/view_changes.rs crates/nikaia-std/src/tools/lowered/check_core_stmt.rs crates/nikaia/src/view_changes.rs crates/nikaia/src/check/mod.rs crates/nikaia/src/emit/mod.rs crates/nikaia/src/contracts/keep.rs
Commit: view_changes: a read of a place under a mutable view is NK2305; let mut of a struct field is a view (#962)
Fixes: #962