Result: done Files: crates/nikaia-std/src/tools/check_core_call_on.nika crates/nikaia-std/src/tools/lowered/check_core_call_on.rs tests/compiler/tests/an_or_insert_with_lambda_builds_its_text.nika tests/compiler/tests/an_or_insert_with_lambda_builds_its_text.stdout docs/briefs/b976.md.report.md Commit: check: or_insert_with’s lambda hands back the map’s value, and the text its body ends in is built Fixes: #977 Model: Opus 5.5 Tests: an_or_insert_with_lambda_builds_its_text and a_let_mut_view_is_assigned_through (both failed on the unfixed compiler: rustc mismatched types; NK1105/E0368); nikaia test –both-settings –project tests/compiler 331 ok (own binary copy); it guard set + map_entries mut_bindings mut_parameter_parts lending element_views map_reads 92 ok; clippy clean; pre-push-check ok; lower-std fixpoint (rebuild a no-op) Gate: green Deviation: two commits: df022c05 (#976: check_core_stmt_let types an entry view of a number as the number; check_core_expr_variable marks every mention of such a view, check_core_stmt_assign the target of any let mut view, in facts.view_derefs; emit_expr_variable writes c, emit_core_postfix_base parenthesises it, a reborrowed arg stays &mut *c), this one (#977: check_core_call_on_now_expected gives or_insert_with’s fn() the map’s value as its result, a_lambdas_text_is_its_own builds the body’s tail text). lowered.rs not staged (foreign comptime_tree names only). #977 step 2 not built: a defect, see Found. Found: DEFECT (new, file it, ready): a nested list’s element is not linked to the parameter it is handed to (ADR-282 D16: a list with a position is linked to where it goes, one tier; D12: the element of a declared list is a position). Probe: fn add(mut all: Vec[String], x: String) { all.push(x.clone()) }; let mut lists: Vec[Vec[String]] = [[], [“q”]]; add(lists[1], “r”) is NK1102 (passing Vec[ref String]), so is let mut e = lists[1]; add(e, “r”), while let mut one: Vec[String] = [“q”]; add(one, “s”) passes. Cause: text_tiers source_of/place_of have no Index case and Declaring carries no path, so link_from takes lists[1] as unlinkable. To build: 1. Declaring (or source_of) carries the path inside its owner, Expr::Index of a list giving the element [0]; link_from and tier_let’s untyped let use it. 2. Test in tests/compiler with both probes. Found: DEFECT (new, file it): a change in place through a let mut view of a map’s text value does not make the value text of its own: let mut s: BTreeMap[String, String]; s.insert(“a”, “p”); let mut si = s[“a”] ?? return; si += “!” lowers the map as BTreeMap<&str, &’static str> and (si) += .. fails (rustc: += on &’static str). The same through an entry (t += “!”) works. Needs: none Changelog: none here; for the version raise (supervisor): #976 an assignment or compound assignment to a let mut view (entry or_insert/or_insert_with, m[k] ?? jump, m.get(k) ?? jump, v[i]) writes through it, *c = v / *c += 1, and an entry view of a number, bool or char reads as the value, *c (was NK1105 for =, rustc E0368 for +=); #977 the text a lambda of or_insert_with ends in is built as the map’s value, as or_insert’s is (was rustc mismatched types, vec![&str]) Owner: issue comment for #977: steps 1 and 3 built (this commit). Step 2 checked against ADR-353/ADR-282: not meant. ADR-353 D8 and ADR-282 D16 say a list with a position is linked to where it goes and gets one tier, so lists[1] handed to a mut Vec[String] parameter should take text of its own; the NK1102 is a tier-pass defect (filed separately, see the new issue) Disk freed: see SubagentHandback Rs2nika: none (no move) Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq Pushed: 5c15a3b681cfe3a7da9f6809c52b7623f979a5c7

This site is open source. Improve this page.