Result: partial Files: crates/nikaia-std/src/tools/check_core_stmt.nika crates/nikaia-std/src/tools/check_core_flow.nika crates/nikaia-std/src/tools/check_boundary.nika crates/nikaia-std/src/tools/check_core_leaves.nika crates/nikaia-std/src/tools/lowered/check_core_stmt.rs crates/nikaia-std/src/tools/lowered/check_core_flow.rs crates/nikaia-std/src/tools/lowered/check_boundary.rs crates/nikaia-std/src/tools/lowered/check_core_leaves.rs crates/nikaia-std/src/tools/lowered/check_items.rs tests/compiler/tests/an_unwrapped_map_view_stays_a_view.nika tests/compiler/tests/an_unwrapped_map_view_stays_a_view.stdout Commit: check: a view unwrapped by ?? or a match stays a view (part of #1107) Body: Four causes, each fixed where it was. (1) let c: ref C = m[k] ?? return null / m.get(k) ?? ...: check_core_stmt_let asked ADR-354’s element-view rule only of a bare place; it now also asks it of an element read past a jump (check_core_stmt_an_element_past_a_jump), sharing one rule with check_core_stmt_element_view (check_core_stmt_read_viewed), as kind 3 (not a lent let), because the read past the jump is the reference below already. (2) the match binding over a view with a null arm took ref only for a type that moves (check_core_flow, takes_away); a struct that copies is lent too (ADR-279 D8). (3) an unannotated let c = m[k] ?? return null of a struct that does not copy (already a reference below, view_of since #1044) is now typed ref C, as let c = m[k] is. (4) return m.get(k) into ref C? is a view (a_get_off_a_lent_parameter, by the parameter’s type, since lending is asked before the call is typed), with no & added. The NK1131 of #1044/#1057 (an_element_read_handed_back_by_value, a_field_of_an_element_read_handed_back) is kept for such a view: the binding keeps its view_of (viewed_past_a_jump), check_core_a_lent_place_given_away asks does_not_copy of what the view views, and a return it refuses is not asked again for its type. The only tools lowering that changed is check_items.rs (&generic -> generic, the view now bound). The test’s rows 4-5 use a struct that does not copy, see Deviation. Part: #1107 Tests: new an_unwrapped_map_view_stays_a_view refused 8 times by the unfixed binary, passes and prints the expected lines on the fixed one; probe rows 1-3, 6-8 pass with the issue’s C { n: i64 }, rows 4-5 pass with a non-copy struct; regression probe (copy struct read past a jump then let d: C = c, take(c), push(c)) unchanged; it – coalesce view map_read element_read: 221 passed 0 failed; tests/compiler –both-settings: 531 passed 0 failed (an earlier run’s 7 failures were target/fast/nikaia vanishing mid-run and a missing tmp file, gone on the re-run); fmt, clippy -D warnings, pre-push-check.sh, lower-std fixpoint clean Gate: green Deviation: rows 4-5 (let c = m[k] ?? return null without a type, then handed back as ref C) still NK1104 for a struct that copies (the issue’s C { n: i64 }); fixed for one that does not copy. Found: none Needs: architect decision: a ref C of a struct that copies given where a C is wanted is refused (let e: ref C = xs[0]; let g: C = e is NK1103 on develop; ADR-279 D9 suggests a copy). Binding the unannotated read past a jump as a view for copy structs made let d: C = c refuse (NK1183/NK1103) where it compiled before, so that part waits for the decision; once a copy view is copied out, check_core_stmt_a_lent_struct drops its does_not_copy condition. Issue comment: the probe and rows 2, 3, 6 fixed; rows 4-5 fixed for non-copy structs, copy structs wait on the above. Changelog: A list or map element unwrapped by ?? return or a match binding, and m.get(k) handed back, stay views of the element where a ref T is declared. Owner: none Disk freed: scratch binaries (about 0.2 GB); target/nikaia-project-tests 2.6G, / 3.2G free; new cache entries over 100 MB: rlib/df8bcfe6 505 MB, rlib/af187e66 266 MB, run-bundle/3f8b93b8 349 MB, build-time-parsers/768d2772 661 MB, build-time-bundle/efd5abe9 544 MB Rs2nika: none Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq Pushed: local a062b45a032f17a12c98d6fa1b3427fd5779644c

This site is open source. Improve this page.