iter env-unify.audit: tidy stale Env docs, pin-test docstring; queue types/ctor_index shape

This commit is contained in:
2026-05-10 02:36:27 +02:00
parent e414144d48
commit c3fd1c08a3
3 changed files with 55 additions and 10 deletions
+8 -5
View File
@@ -2503,15 +2503,18 @@ pub struct Env {
/// (qualified cross-module reference).
pub imports: BTreeMap<String, String>,
/// Top-level symbol table per module of the workspace.
/// `check_in_workspace` populates this from `build_module_globals`.
/// Populated by [`crate::build_check_env`] from
/// [`build_module_globals`].
pub module_globals: BTreeMap<String, IndexMap<String, Type>>,
/// Per-module import map: module-name → (alias-or-module-name →
/// actual-module-name). Sibling-shape to [`Self::module_globals`];
/// populated only by [`crate::mono::build_workspace_env`] so the
/// populated workspace-flat by [`crate::build_check_env`] so the
/// mono pass's per-fn entry points can re-seed the local
/// [`Self::imports`] before re-running [`synth`] on a body.
/// `check_in_workspace` does not populate this — it has the module
/// in hand and seeds [`Self::imports`] directly.
/// [`Self::imports`] before re-running [`synth`] on a body. Both
/// `check_in_workspace` and `mono::build_workspace_env` consume
/// the same env shape; `check_in_workspace` then overwrites
/// [`Self::imports`] with the current module's map at the call
/// site.
pub module_imports: BTreeMap<String, BTreeMap<String, String>>,
/// Iter 15a: ADT type definitions per module of the workspace. Used
/// to resolve qualified type references (`module.Type` in
@@ -23,11 +23,14 @@ fn examples_dir() -> std::path::PathBuf {
.join("examples")
}
/// In-test reproduction of the pre-refactor `check_in_workspace`
/// workspace-flat seeding (the inline seeding that lived in
/// `check_in_workspace` before this milestone). Kept as a frozen
/// reference: any future divergence between this body and
/// `build_check_env` makes the assertion below fail.
/// Independent reproduction of every workspace-flat env seeding
/// step. Pre-refactor, workspace-flat seeding was split between
/// `check_in_workspace` (per-module `types`/`ctor_index`) and
/// `mono::build_workspace_env` (workspace-flat `types`/`ctor_index`
/// plus everything else); this reproduction captures the *union*
/// — exactly the surface `build_check_env` is responsible for.
/// Kept as a frozen reference: any future divergence between this
/// body and `build_check_env` makes the assertion below fail.
fn build_env_inline_pre_refactor(ws: &ailang_core::workspace::Workspace) -> Env {
let mut env = Env::default();
ailang_check::builtins::install(&mut env);