Feat(types): land Slice TY2 — bidirectional core #14

Manually merged
hkowalski merged 1 commit from feat/014-feat-types-land-slice-ty2-bidirectional-core into master 2026-01-19 08:00:00 +01:00
Owner

Feat(types): land Slice TY2 — bidirectional core

Along the way:

  • feat(types): land Slice TY2 — bidirectional core

Touches 25 files: docs/impl/slices.md, docs/impl/type-system/README.md, docs/impl/type-system/TY2-bidirectional-core.md, docs/impl/type-system/TY6-construction-and-projection.md, src/rust/Cargo.lock, src/rust/crates/ck_cktest/Cargo.toml and 19 more.

Feat(types): land Slice TY2 — bidirectional core Along the way: - feat(types): land Slice TY2 — bidirectional core Touches 25 files: `docs/impl/slices.md`, `docs/impl/type-system/README.md`, `docs/impl/type-system/TY2-bidirectional-core.md`, `docs/impl/type-system/TY6-construction-and-projection.md`, `src/rust/Cargo.lock`, `src/rust/crates/ck_cktest/Cargo.toml` and 19 more.
hkowalski approved these changes 2026-01-17 12:27:00 +01:00
hkowalski left a comment

Reads well. One question on src/rust/crates/ck_types/src/lib.rs, nothing blocking.

Reads well. One question on `src/rust/crates/ck_types/src/lib.rs`, nothing blocking.
@ -0,0 +54,4 @@
/// The type recorded for a local binder, if any.
#[must_use]
pub fn type_of_local(&self, id: LocalId) -> Option<&Ty> {
Owner

type_of_local is public. Does anything outside the crate call it, or is it pub because that was easier? Every public item is a promise.

`type_of_local` is public. Does anything outside the crate call it, or is it pub because that was easier? Every public item is a promise.
@ -393,0 +581,4 @@
}
#[test]
fn display_renders_each_variant_in_its_keyword_form() {
Owner

display_renders_each_variant_in_its_keyword_form reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?

`display_renders_each_variant_in_its_keyword_form` reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?
Author
Owner

Split. The decision in display_renders_each_variant_in_its_keyword_form is a pure function now, with its own tests in src/rust/crates/ck_types/src/lib.rs.

Split. The decision in `display_renders_each_variant_in_its_keyword_form` is a pure function now, with its own tests in `src/rust/crates/ck_types/src/lib.rs`.
Author
Owner

Nothing outside calls type_of_local. It is pub(crate) in src/rust/crates/ck_types/src/check.rs now.

Nothing outside calls `type_of_local`. It is pub(crate) in `src/rust/crates/ck_types/src/check.rs` now.
Lands the first walking slice of the type checker. `ck_types` gains the
fail-soft `Ty::Unknown` sentinel (absorbing composites, one short-circuit
in `assignable`), the `TypeRef → Ty` lift, the eager `lift_signatures`
pre-pass, and the bidirectional `TypeckResults` walker that emits the
four new E07xx codes:

- E0701 — argument-count mismatch at a call site
- E0702 — argument-type mismatch
- E0703 — trailing-expression vs. declared return
- E0704 — non-function callee

`ck_syntax` adds the minimal projections TY2 needs: `TypeRef<'a>`
(over `TypeExpr` / `UnionType`), plus `Param::ty`, `FnDecl::return_type`,
and `LetStmt::ty`. `ck_cktest` wires the type-check pass into the
conformance pipeline via a new `typecheck_pages` step.

Gating fixtures under `tests/types/`: let_infers_int,
trailing_expr_unit_mismatch, arg_type_mismatch, arity_mismatch,
unknown_callee, clean_body. Two parser fixtures gained `-> Int` to stay
type-clean.

Const annotations, op signatures, and actor slots remain deferred per
the spec's "what's open"; the body walker treats absent entries as
`Unknown`, keeping the cascade silent until later slices land.
hkowalski manually merged commit 192a3192c8 into master 2026-01-19 08:00:00 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
northgale/cklang-bootstrap!14
No description provided.