types(TY8): or-surface variant tracking + Panic::raise payloads #35

Manually merged
tvidal merged 4 commits from feat/035-types-ty8-or-surface-variant-tracking-panic-ra into master 2026-02-11 09:30:00 +01:00
Owner

types(TY8): or-surface variant tracking + Panic::raise payloads

Along the way:

  • types(TY8e): closed Error existential + full catch typing
  • docs(TY8): reconcile README cascade row with TY8e-complete status
  • runtime: retire the ck_eval tree-walker and the REPL — single execution path

Touches 50 files: docs/impl/08-diagnostics.md, docs/impl/runtime-testing/README.md, docs/impl/runtime/00-executor.md, docs/impl/type-system/README.md, docs/impl/type-system/TY2-synthesis-core.md, docs/impl/type-system/TY8-or-surface-and-panic-payloads.md and 44 more.

types(TY8): or-surface variant tracking + Panic::raise payloads Along the way: - types(TY8e): closed Error existential + full catch typing - docs(TY8): reconcile README cascade row with TY8e-complete status - runtime: retire the ck_eval tree-walker and the REPL — single execution path Touches 50 files: `docs/impl/08-diagnostics.md`, `docs/impl/runtime-testing/README.md`, `docs/impl/runtime/00-executor.md`, `docs/impl/type-system/README.md`, `docs/impl/type-system/TY2-synthesis-core.md`, `docs/impl/type-system/TY8-or-surface-and-panic-payloads.md` and 44 more.
Author
Owner

Named them all. A new variant is a compile error in src/rust/crates/ck_types/src/field_access.rs now, which is where we want to find out.

Named them all. A new variant is a compile error in `src/rust/crates/ck_types/src/field_access.rs` now, which is where we want to find out.
Author
Owner

Pushed a fix for both. The second pass on src/rust/crates/ck_types/src/field_access.rs is much smaller than the first.

Pushed a fix for both. The second pass on `src/rust/crates/ck_types/src/field_access.rs` is much smaller than the first.
tvidal requested changes 2026-02-11 09:25:00 +01:00
Dismissed
tvidal left a comment

Mostly there, but the question on src/rust/crates/ck_types/src/field_access.rs needs an answer before this lands.

Mostly there, but the question on `src/rust/crates/ck_types/src/field_access.rs` needs an answer before this lands.
@ -52,0 +49,4 @@
Ty::Existential(ExistentialKind::Error) => {
existential_error_field(field_name, cx.interner, cx.scope, cx.field_types)
}
_ => read_field(
Owner

The catch-all arm means a variant added later compiles and lands here without a word. Can the match on _ name every variant so the compiler tells us?, at src/rust/crates/ck_types/src/field_access.rs:52.

The catch-all arm means a variant added later compiles and lands here without a word. Can the match on `_` name every variant so the compiler tells us?, at src/rust/crates/ck_types/src/field_access.rs:52.
tvidal approved these changes 2026-02-11 09:25:00 +01:00
tvidal left a comment

That is it for src/rust/crates/ck_types/src/field_access.rs. Thanks for the second pass.

That is it for `src/rust/crates/ck_types/src/field_access.rs`. Thanks for the second pass.
dferreira approved these changes 2026-02-11 09:25:00 +01:00
dferreira left a comment

Second read on src/rust/crates/ck_types/src/field_access.rs. Nothing to add.

Second read on `src/rust/crates/ck_types/src/field_access.rs`. Nothing to add.
Add or-surface error-variant flow and panic-raise typing:
- generic_call.rs: generic instantiation path extracted for call sites
- panic_raise.rs: Panic::raise terminates the stack (Nothing), hint payload
- E07xx diagnostics for unhandled/return-outside-surface/assert-in-surface
- fixtures: union consumption, error-variant return, raise termination
Land the final TY8 sliver — the one new `Ty` variant in the cascade and the
catch transport, end-to-end through the front-end:

- Ty::Existential(ExistentialKind::Error): opaque under assignable (identity
  only); concrete `composes Error` packs in solely at the Panic::raise cause site
- `_` as a standalone wildcard type (SyntaxKind::WildcardType) — lexer/parser
- StmtKind::Catch lowered from CatchStmt; type stage binds the error local from
  the binder (concrete / or-union / `_` / `Error` -> existential)
- existential field reads (e.hint) route through the Error trait's fields
- match on the existential requires a `_` arm (E0719, specialized open-set rule)
- anonymous `catch(e)` with no `: Type` -> E0725
- three-arg `Panic::raise<T,C>` types `cause` as the existential

Fixtures: catch_wildcard_error, catch_concrete_binds, catch_anonymous_rejected,
match_existential_requires_wildcard(+_wildcard_clean), panic_raise_with_cause(+
_cause_not_error). Docs: TY8 status -> landed, E0725 registered.

Deferred: Error's site/stacktrace/cause field *types* (need the stdlib unit's
SourceLoc/Frame/NoCause); catch *runtime* semantics (lowering/runtime slices).

Gates: build + test + clippy -D warnings + fmt + R1-R4 architecture all green.
Remove the in-process tree-walker (ck_eval) and the interactive REPL so the
bootstrap has one way to run: lowering → Cranelift → object → run (not yet
landed). The tree-walker only ever handled literals/binops/Assert::* and the
REPL's `spawn` ran hollow no-op actors — both were parallel pseudo-execution
surfaces divergent from the codegen path. Until codegen exists, nothing runs
in-process; loaded bodies are type-checked and lowered, never walked.

- delete the ck_eval crate (workspace member + ck_driver dep)
- ck_driver: drop run_test/run_test_fn/TestLookup and the LoadedProgram fields
  that fed the walker (tree/resolved/builtin_assert/path); load.rs runs body
  resolution for diagnostics only
- remove the REPL (repl.rs, `ck --interactive`); `ck` is now `ck check <path>`
  — single-file front-end → render diagnostics (clean exits 0, diags exit 1)
- corpus: replace the six evaluator-driven assert tests with the order-1
  actor-Main lifecycle (run_actor), like noop; the assertions fixtures stay as
  forward-looking codegen targets
- keep ck_rt (floor substrate) + the MetaEvent order-2 contract +
  ck_cktest::reconcile_traps — pub/generic, the seam the codegen path lands on
- reconcile the arch graph, docs (00-executor banner, runtime-testing link),
  and the evaluator comments across ck_rt/ck_resolve

Gates: cargo fmt --check, clippy --all-targets -D warnings, cargo test — all green.
tvidal manually merged commit 3d451a4710 into master 2026-02-11 09:30:00 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 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!35
No description provided.