modules: L6 — stdlib unit injection into the loader closure #31
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/031-modules-l6-stdlib-unit-injection-into-the-load"
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?
modules: L6 — stdlib unit injection into the loader closure
Along the way:
"""…"""token + stdlib .ckh/.ck header splitTouches 42 files:
docs/impl/module-system/README.md,docs/impl/resolution/N4-qualified-paths.md,docs/impl/slices.md,src/rust/Cargo.lock,src/rust/crates/ck_cktest/tests/load_link_resolve.rs,src/rust/crates/ck_driver/Cargo.tomland 36 more.A clear improvement. The change in
src/rust/crates/ck_lex/src/lib.rsis the part I would have argued for.@ -89,1 +109,3 @@let scope = linked.modules.scope(main_id).expect("Main scope");.module(interner.intern(entry)).expect("entry module id");let scope = linked.modules.scope(id).expect("entry module scope");The expect message on
scopeis 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_cktest/tests/load_link_resolve.rs:111.@ -461,1 +462,4 @@/// Whether the cursor (known to be on `"`) opens or closes a `"""`/// triple-quote, as opposed to a `"`/`""` string literal.fn at_triple_quote(&self) -> bool {at_triple_quotereads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?Split. The decision in
at_triple_quoteis a pure function now, with its own tests insrc/rust/crates/ck_lex/src/lib.rs.It said what I assumed. Reworded in
src/rust/crates/ck_cktest/tests/load_link_resolve.rsso it names the input that broke it, which is what the bug report will need.Looked through
src/rust/crates/ck_lex/src/lib.rsas well. Fine by me."""…"""token + stdlib .ckh/.ck header split 6d2e83ef73Three connected pieces, all surfaced by reconciling the corpus against a project *closure* (app + injected stdlib) instead of single-file resolution: - resolve/paths: `resolve_constructor_path` — a record-literal head that is a qualified type path (`Error::OutOfMemory {}`, `Shapes::Point { … }`) resolves to the type instead of tripping N4's value-position wrong-kind check (E0303). The relaxation is scoped to record-literal heads; a bare qualified type in value position still fires E0303. - resolve/paths: `narrow_in_module` falls back to a same-named effect's ops, so the stdlib capability pattern (`mod Log` wrapping `effect Log`) resolves `Log::info` / `Panic::raise` to the wrapped op. - resolve/bodies: `resolve_record` dispatches record literals (qualified head → constructor path, bare head → single-segment ref, field values as ordinary value exprs). - driver/load: `closure_diagnostics` runs the whole front-end (loader + N2 effects + link + N3 bodies) over the project closure and attributes diagnostics per app-owned file, so the corpus harness reconciles cross-module and `.ckh`/`.ck` header refs. Adds the `ck_load` workspace dep. - corpus: trap.md files re-reconciled now that closure resolution binds the refs that single-file resolution could not. architecture: MAX_FILE_LOC 805 → 813 for bodies.rs (gained `resolve_record`), ck_load added to ck_driver's expected dep graph. Gates: cargo build + clippy --all-targets -D warnings + cargo test (43 suites) all clean; corpus_apps_match_their_trap_md reconciles.