feat(traits T-2): Prelude.ck + Types.ck traits tier live; PRIMITIVE_TRAITS DELETED #69
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/069-feat-traits-t-2-prelude-ck-types-ck-traits-tie"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat(traits T-2): Prelude.ck + Types.ck traits tier live; PRIMITIVE_TRAITS DELETED
Along the way:
Touches 45 files:
slice_traits.md,src/rust/crates/ck_codegen/src/lib.rs,src/rust/crates/ck_codegen/src/record_value.rs,src/rust/crates/ck_codegen/src/user_fn.rs,src/rust/crates/ck_codegen/src/value.rs,src/rust/crates/ck_driver/src/compile/mono.rsand 39 more.Two things inline. The one in
src/rust/crates/ck_parser/src/tests/impl_decl.rsis the one I care about.@ -0,0 +44,4 @@/// well-formed `cklang;<passes>;<seconds>;1;…bits=1` line with a positive/// score and ≥ 5.0 s elapsed, freestanding.#[test]fn actor_races_five_seconds_bit_packed_and_reports_a_wellformed_drag_race_line() {actor_races_five_seconds_bit_packed_and_reports_a_wellformed_drag_race_linereads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?@ -151,0 +162,4 @@out.diagnostics);let i = find_first(&out.tree, SyntaxKind::ImplDecl).expect("ImplDecl");let f = find_first(i, SyntaxKind::FnDecl).expect("FnDecl");The expect message on
fis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?, at src/rust/crates/ck_parser/src/tests/impl_decl.rs:165.@ -378,0 +410,4 @@// arena: Arena |)` returning `(| h, a |)` must stay legal.let handle = nominal(200, vec![]);let arena = nominal(201, vec![]);let positional = Ty::tuple(vec![handle.clone(), arena.clone()]);positionalis cloned on what looks like a hot path. Is the ownership forced here, or can this borrow?It said what I assumed. Reworded in
src/rust/crates/ck_parser/src/tests/impl_decl.rsso it names the input that broke it, which is what the bug report will need.Split. The decision in
actor_races_five_seconds_bit_packed_and_reports_a_wellformed_drag_race_lineis a pure function now, with its own tests insrc/rust/crates/ck_driver/tests/primes_actor_garage_bitwise_run.rs.It can borrow. The clone of
positionalwas left over from before the lifetime was threaded throughsrc/rust/crates/ck_types/tests/assignable.rs, and it is gone.Good. The second pass on
src/rust/crates/ck_parser/src/tests/impl_decl.rsis what I hoped for.Second read on
src/rust/crates/ck_parser/src/tests/impl_decl.rs. Nothing to add.Pushed a fix for both. The second pass on
src/rust/crates/ck_parser/src/tests/impl_decl.rsis much smaller than the first.The ruling: 'not' is an ordinary identifier in a NAME slot (fn-decl name in module/impl/trait, method selector after '.'); everywhere else it stays the hard keyword. ONE generic mechanism (ck_parser/src/name_slot.rs, R3-cap respected by extraction): expect_name accepts Ident or any is_contextual_name_kw token and re-tags it Ident in the CST — the contextual set is named in exactly one place; no per-callsite probe, no Not-specific arm. Wired at the three name-acceptance points (fn_decl, trait_decl, postfix member selector). Prelude.ck: trait Not<T> + impl Not<Bool> (= Floor::ieq(a, false), the authored soll body over an existing leaf) — the T-2 omission is closed; header divergence note removed. Coverage: 4 parser unit tests — fn not in impl, fn not in trait decl, x.not() selector, and the negative ('not x' stays UnaryExpr/keyword). Gates (orchestrator-run): fmt 0 · clippy -D warnings 0 · 147/147 cargo summaries ok · arch 15/15 · stdlib_type_clean green (full Prelude incl. Not resolves + typechecks) · ratchet 98 unchanged. Net Rust delta: +80 src LoC (the one generic name-slot mechanism) + 97 test LoC; the Not knowledge itself lives in Prelude.ck.