docs(types): note TY8's payload typing feeds the system-unwinder landing pad #21
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/021-docs-types-note-ty8-s-payload-typing-feeds-the"
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?
docs(types): note TY8's payload typing feeds the system-unwinder landing pad
Along the way:
Touches 36 files:
docs/impl/03-parser.md,docs/impl/memory-model/arenas.md,docs/impl/type-system/TY8-or-surface-and-panic-payloads.md,docs/traits.md,docs/types.md,scripts/test.shand 30 more.Split. The decision in
parse_empty_literal_turbofishis a pure function now, with its own tests insrc/rust/crates/ck_parser/src/expr.rs.A clear improvement. The change in
src/rust/crates/ck_parser/src/expr.rsis the part I would have argued for.@ -308,0 +354,4 @@/// child, so the existing record-literal AST projection walks it/// unchanged. Caller has verified the shape via/// [`Self::at_empty_literal_turbofish`].fn parse_empty_literal_turbofish(&mut self) {parse_empty_literal_turbofishreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?The Q4 resolution from this session's design pass. The type-declaration universe is exactly five keywords (`type`, `newtype`, `record`, `data`, `trait`), each with one job; `composes` mixes in traits only, never other newtypes/records/data; lowercase parameters on `newtype` / `trait` / `record` contribute a field of the same name AND participate in type identity (so `String<size: u8>` means every String value carries `s.size: u8` *and* `String<12> != String<13>`); `data` variants grew an optional turbofish slot for the type-level discriminator (`AdminRole::<Admin>(Duration)`); trait names are barred from value-position type annotations as a hard parse/type error to keep the no-subtyping lock honest. Lands in `docs/types.md` (new "Five type-declaration keywords" section, extended "Collections carry a maximum size" with the parameter-as-field mechanism) and `docs/traits.md` (new "Named lowercase parameters" section, sharpened "Traits are bounds, not types" with the parse-error clause). `tests/corpus/types/` is the worked demonstration corpus: - Aliases.ck — `type` as alias only - Bounded.ck — Sized / Collection traits + List / Map / RingBuffer - Roles.ck — type-level tag mint via `newtype Role<tag: Name>`, the `data Roles` sum that gathers them, and retag-via-`with` The corpus is intentionally future CkLang: six grammar slices remain to lift before it parses cleanly (`type` keyword, `newtype` keyword, lowercase-named generic params, variant turbofish slot, `{}::<T> with` empty-literal turbofish, `where` on free fns). `scripts/test.sh --corpus[:NAME[:FILE]]` drives the smoke harness in `crates/ck_parser/tests/corpus.rs` so the picture is one command away.