Result: done Files: crates/nikaia-std/src/tools/text_tiers.nika crates/nikaia-std/src/tools/lowered/text_tiers.rs tests/compiler/tests/to_string_of_view_owned.nika tests/compiler/tests/to_string_of_view_owned.stdout tests/compiler/tests/to_string_of_loop_view_refused.nika tests/compiler/tests/to_string_of_loop_view_refused.stderr Commit: text_tiers: a match arm’s name beside null is bound to what the match is on, and a view of a loop’s element is no keep’s (Fixes #1144) Body: Two causes in text_tiers.nika. (1) In a match, a bare name beside a null arm (or Some(a)) over a call such as full.strip_prefix(..) was never bound in the tier walk. An unbound name counts as owned text, so rest.to_string() came out as a view of nothing, and the lowering wrote &str with no lifetime: rustc said “missing lifetime specifier”. The new bind_bare_payload binds it to the subject’s kinds, as let rest = .. ?? continue does, so the s3_gap3b probe now compiles (static text). (2) A view of an element that a for walks of a list made in the function (a local, or a call’s result like host.names(text)) was kept as a view, though nothing keeps that list past the loop: rustc said “cannot return value referencing local variable”. The new TierLocal.unkept marks such an element and every view of it, through let, ?? and match names (helpers rooted_in_a_parameter, unkept_root). Its .to_string() is now owned text. So the checker refuses it with NK1102 “Write .clone()”, as it already did for a(n).trim().to_string(), and .clone() compiles. No lowered tools file other than text_tiers.rs changed; the lower-std fixpoint is clean. Fixes: #1144 Tests: both new tests failed on the unfixed binary (rustc: missing lifetime specifier; cannot return value referencing local variable full) and pass with –both-settings in a scratch project; it – text_tiers text_literals text_views match_views element_views mapped_text views_handed_back views_kept stored_views keeps tether_keep text_positions: 203 passed; clippy (local 1.97 and 1.99.1) and fmt clean; pre-push green; full tests/compiler not run (driver) Gate: green Deviation: step 1 was built within ADR-282 D8, not as the brief wrote it. The brief asks that v.to_string() of a view be owned String whatever it borrows from. D8 says the text form of text is the text itself, not a copy, and the checker already refuses mk(n).trim().to_string() where owned text is needed (NK1102, “Write .clone()”) on the unfixed binary too. So: the match-arm case compiles; a view of a loop’s element now gets NK1102 instead of a rustc error. S3 writes rest.clone() in names_the_program_writes. Found: none Needs: supervisor decision only if .to_string() of a view should copy (that would reverse ADR-282 D8 and the existing NK1102 help); otherwise none Changelog: A name a match arm binds beside null is typed by what the match is on, and a view of an element a loop walks of a list made in the function, put where text of its own is kept, is refused with NK1102 (write .clone()) instead of failing in rustc (#1144). Owner: none Disk freed: 0 GB; nikaia-project-tests 2.1G, disk 6.1G free; entries over 100 MB newer than the brief (run-bundle 342 MB, build-time-parsers 898 MB) are not from this run (the tests ran in a scratch project) Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq Pushed: local 5279e66937c90b3ce04d5a8a947a2424c3a9f0e9

This site is open source. Improve this page.