Result: done Files: crates/nikaia/src/parser/mod.rs docs/specification/10-nikaia-light.md tests/specification/EXPECTED.txt crates/nikaia-std/src/tools/ast.nika crates/nikaia-std/src/tools/lowered/ast.rs crates/nikaia-std/src/tools/check_boundary.nika crates/nikaia-std/src/tools/lowered/check_boundary.rs crates/nikaia-std/src/tools/check_core_call_on.nika crates/nikaia-std/src/tools/lowered/check_core_call_on.rs crates/nikaia-std/src/tools/check_core_comptime.nika crates/nikaia-std/src/tools/lowered/check_core_comptime.rs crates/nikaia-std/src/tools/check_core_stmt.nika crates/nikaia-std/src/tools/lowered/check_core_stmt.rs crates/nikaia-std/src/tools/check_exprs.nika crates/nikaia-std/src/tools/lowered/check_exprs.rs crates/nikaia-std/src/tools/check_function.nika crates/nikaia-std/src/tools/lowered/check_function.rs crates/nikaia-std/src/tools/check_lambdas.nika crates/nikaia-std/src/tools/lowered/check_lambdas.rs crates/nikaia-std/src/tools/check_narrow.nika crates/nikaia-std/src/tools/lowered/check_narrow.rs crates/nikaia-std/src/tools/check_notes.nika crates/nikaia-std/src/tools/lowered/check_notes.rs crates/nikaia-std/src/tools/check_reports.nika crates/nikaia-std/src/tools/lowered/check_reports.rs crates/nikaia-std/src/tools/check_state.nika crates/nikaia-std/src/tools/lowered/check_state.rs crates/nikaia-std/src/tools/check_takes.nika crates/nikaia-std/src/tools/lowered/check_takes.rs crates/nikaia-std/src/tools/comptime_tree.nika crates/nikaia-std/src/tools/lowered/comptime_tree.rs crates/nikaia-std/src/tools/emit_stmt.nika crates/nikaia-std/src/tools/lowered/emit_stmt.rs crates/nikaia-std/src/tools/node_numbers.nika crates/nikaia-std/src/tools/lowered/node_numbers.rs crates/nikaia-std/src/tools/parse_errors.nika crates/nikaia-std/src/tools/lowered/parse_errors.rs crates/nikaia-std/src/tools/parser_grammar.nika crates/nikaia-std/src/tools/lowered/parser_grammar.rs crates/nikaia-std/src/tools/tree_build.nika crates/nikaia-std/src/tools/lowered/tree_build.rs crates/nikaia-std/src/tools/type_rules.nika crates/nikaia-std/src/tools/lowered/type_rules.rs tests/compiler/tests/immutable_binding_is_read.nika tests/compiler/tests/immutable_binding_is_read.stdout tests/compiler/tests/immutable_holds_a_channel_end.nika tests/compiler/tests/immutable_holds_a_channel_end.stderr tests/compiler/tests/immutable_holds_a_locked_variant.nika tests/compiler/tests/immutable_holds_a_locked_variant.stderr tests/compiler/tests/immutable_holds_a_shared_mut_element.nika tests/compiler/tests/immutable_holds_a_shared_mut_element.stderr tests/compiler/tests/immutable_holds_a_shared_mut_field.nika tests/compiler/tests/immutable_holds_a_shared_mut_field.stderr tests/compiler/tests/immutable_is_a_reserved_word.nika tests/compiler/tests/immutable_is_a_reserved_word.stderr tests/compiler/tests/immutable_is_not_changed_by_a_method.nika tests/compiler/tests/immutable_is_not_changed_by_a_method.stderr tests/compiler/tests/immutable_is_not_moved_out_of.nika tests/compiler/tests/immutable_is_not_moved_out_of.stderr tests/compiler/tests/immutable_item_is_not_built_yet.nika tests/compiler/tests/immutable_item_is_not_built_yet.stderr tests/compiler/tests/immutable_lambda_captures_a_shared_mut.nika tests/compiler/tests/immutable_lambda_captures_a_shared_mut.stderr tests/compiler/tests/immutable_mut_does_not_exist.nika tests/compiler/tests/immutable_mut_does_not_exist.stderr tests/compiler/tests/immutable_shared_of_a_shared_mut.nika tests/compiler/tests/immutable_shared_of_a_shared_mut.stderr Commit: immutable: the reserved word, the binding inside a function and the deep rule NK1331 (ADR-389 D1, D2, D6) Body: Steps 1-4 of p1199a in one commit, because reserving the word needs the checker’s CheckLocal.immutable field renamed (without_mut) in 13 tools files. Lexer: immutable joins RESERVED_WORDS (parse_errors.nika), the KW_ rules of the live Rust grammar (parser/mod.rs) and parser_grammar.nika, and Part I 2.1’s table. Parser: immutable x [: T] = e is a Stmt::Let with the new field deep: true; immutable mut and an item-level immutable (with or without pub) are parse errors with a sentence (item level is p1199b). Checker (check_core_stmt.nika): a deep let walks the bound type through type arguments, fields, tuple parts, enum variants (own tables and the contract) and a lambda initializer’s captures, and refuses the first SharedMut, Locked or channel end with NK1331 at the initializer, naming its path; Shared[T] and Box[T] are walked through. CheckKind::Immutable makes a change or a ref mut self call NK1331 (a_changed_binding_says_mut) and a move out NK1331 (check_takes.nika). Code generation: a plain let. The Rust added: the grammar rules in parser/mod.rs (the live parser is Rust), about 50 lines, for #557 / #125. tests/specification/EXPECTED.txt: Part I’s immutable DUMP_DIR block now parses (tried as a body, NK1117) instead of being a fragment. Part: #1199 Pushed: local 3f8dd4c953454d76570d6c29bc83ee9c702a3176 Tests: 12 new tests/compiler/immutable_*.nika pass (scratch project, nikaia test); full it binary 2886 passed, the one failure specification::the_specifications_programs_are_the_ones_in_expected_txt fixed by the EXPECTED.txt line above; parser:: unit tests, cargo fmt, clippy -D warnings, lower-std fixpoint clean. Not run against an unfixed compiler: none was available (the build in target/fast already had the half-built change); before it, immutable x = e did not parse at all. Gate: green Deviation: none Found: none Needs: none Changelog: immutable, a deeply immutable binding inside a function: immutable x = e or immutable x: T = e; a value reaching a SharedMut, Locked or channel end is refused (NK1331, naming its path), as are a ref mut self call on it and a move out of it; immutable is now a reserved word. Owner: none Disk freed: none Rs2nika: none Attribution: Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq

This site is open source. Improve this page.