Loading…
Reference in a new issue
No description provided.
Delete branch "feat/077-fix-values-record-fields-carry-their-full-word"
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?
fix(values): record fields carry their full word list (debt #63) + named-tuple projection lands (debt #38) — Alloc::alloc callable
Along the way:
where T is A or Bmeans it; byte joins Floor's where-listsTouches 75 files:
Floor.ck,plan_training.md,scripts/cklang_ai.sh,src/rust/crates/ck_cktest/src/pipeline.rs,src/rust/crates/ck_driver/src/compile/mod.rs,src/rust/crates/ck_driver/src/compile/typecheck.rsand 69 more.Two things inline. The one in
src/rust/crates/ck_driver/tests/string_value_run.rsis the one I care about.@ -0,0 +93,4 @@/// `ckc --container <shared> --work <name> run <app> --stdlib <repo>/tests/corpus/stdlib`,/// returning the process exit code.fn run_ck(name: &str, app: &Path) -> i32 {run_ckreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?, at src/rust/crates/ck_driver/tests/string_value_run.rs:96.@ -0,0 +14,4 @@/// bound was checked against; secondary on the bound's declaration in the/// callee's `where`-clause.#[must_use]pub fn e0710_concrete(e0710_concreteis public. Does anything outside the crate call it, or is it pub because that was easier? Every public item is a promise.Split. The decision in
run_ckis a pure function now, with its own tests insrc/rust/crates/ck_driver/tests/string_value_run.rs.Nothing outside calls
e0710_concrete. It is pub(crate) insrc/rust/crates/ck_types/src/diag/constraints.rsnow.Good. The second pass on
src/rust/crates/ck_driver/tests/string_value_run.rsis what I hoped for.Pushed a fix for both. The second pass on
src/rust/crates/ck_driver/tests/string_value_run.rsis much smaller than the first.where T is A or Bmeans it; byte joins Floor's where-lists d9c5345bd1A declared union bound now constrains. `resolve_bound` used to drop every `where T is A or B or …` before the checker saw it (a no-op), so `Floor::iadd::<String>` type-checked only because the bound was inert. It now lifts each enumerated member to its concrete `Ty` (`PredicateBound::Union`), and the call-site predicate check requires the substituted `T` to be `assignable` to at least one member — a member of none diagnoses cleanly at the call site as the newly minted E0750, the union-bound sibling of E0710. Enforcement exposes every out-of-bounds instantiation as a new error, so the where-lists were inventoried and squared first: - byte joins Floor's where-lists wherever u8 appears (21 lines each in tests/corpus/stdlib/Floor.ck, tests/corpus/stdlib/Floor.ckh, and the repo-root soll Floor.ck). `byte` is the `{ size: 8, signed: false, float: false }` leaf — a legitimate unsigned 8-bit member beside u8 that Prelude.ck already impls (Add/Sub/Mul/Neg/Equals/Ord/BitAnd/…). Without this, enforcement would fire E0750 on byte_ops, whose operators desugar to `Floor::iadd(byte, …)` etc. No other latent out-of-bounds site surfaced: stdlib_type_clean and the whole corpus stay green with enforcement live (the byte widening was the only one needed). diag.rs would have breached the R3 line cap (840), so the `where`-predicate diagnostic family (e0710_concrete / e0710_discharge / e0712 / e0750) moved to a new diag/constraints.rs sibling, re-exported so `crate::diag::*` import paths are unchanged — the same split discipline as diag/actors.rs and diag/values.rs. This shrinks diag.rs 814→755 rather than raising the cap. Proofs: tests/types/union_bound_unsatisfied.cktest (negative golden, E0750 trapped), tests/types/union_bound_satisfied.cktest (positive control, clean), two predicate.rs unit tests for the union lift, byte_ops exit-42 green, conformance ratchet held at 94.