Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dsl/std/types.dag
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ fn canonical_container_names() -> List<String> {
// require v3 to resolve aliases in Branch input type-checking
// (currently pins Bool as a direct Disj for if/else). Deferred until
// that compiler work lands; keeps intent-signaling via distinct names.
// v3 Path A (Lane 1e-2b): `Bool` still parses here for v2 (`dsl/` is v2-scanned);
// `Declaration.inhabits` → `BooleanAlgebra<Bool>` is applied in v3 bootstrap
// (`bootstrap::patch_kernel_bool_boolean_algebra_inhabits`). Surface
// `type … inhabits … =` is v3-only under `src/v3/compiler/` (generated parser).
// Dissolution: when v2 accepts `inhabits` on types, move the clause here and
// delete `patch_kernel_bool_boolean_algebra_inhabits` (see that function's doc).
// v3 Path A (Lane 1e-2b): `Bool` still parses here for v2 (`dsl/` is v2-scanned;
// see `v2-compiler-tests` `gist_transitive_closure_parse` and stage0 self-host
// fixtures). `Declaration.inhabits` → `BooleanAlgebra<Bool>` is applied in v3
// bootstrap after std fixtures lower (`bootstrap::patch_kernel_bool_boolean_algebra_inhabits`).
// Surface `type … inhabits … =` is v3-only under `src/v3/compiler/` (generated
// parser) and cannot appear in this file until v2 gains a compatible parse path.
type Bool = True | False

// Unit: terminal object (zero-field product, single inhabitant).
Expand Down
18 changes: 9 additions & 9 deletions src/v3/compiler/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ pub const BOOTSTRAP_FIXTURE_PATH_KEYS: &[&str] = &[

/// v3-only inhabitance for kernel `Bool` (Class 5 / Lane 1e-2b Path A).
///
/// `dsl/std/types.dag` must stay free of `inhabits` so v2 can parse every
/// `dsl/` file. After the std fixtures lower, wire `Bool` to
/// `BooleanAlgebra<Bool>` the same way surface `inhabits` lowering would,
/// without shadowing `Bool` (which would reallocate sum variants and break
/// `src/v3/std/algebra.dag` pattern wiring).
/// `dsl/std/types.dag` must stay free of `type … inhabits … =` so v2 can parse
/// every `dsl/` file on the stage0 / gist dependency surfaces (see
/// `v2-compiler-tests::parse::gist_transitive_closure_parse`). After the std
/// fixtures lower, wire `Bool` to `BooleanAlgebra<Bool>` the same way surface
/// `inhabits` lowering would, without shadowing `Bool` (which would reallocate
/// sum variants and break `src/v3/std/algebra.dag` pattern wiring).
///
/// Preconditions are checked: any failure attaches a bootstrap
/// `Diagnostic::ResolveError` via `Dag::attach_diagnostic` so compilation
/// fails closed instead of silently omitting `inhabits`.
///
/// **Dissolution:** remove this patch once the v2 compiler surface accepts
/// `type … inhabits … =` in `dsl/` (then express
/// `type Bool inhabits BooleanAlgebra<Bool> = True | False` in
/// `dsl/std/types.dag` and delete `patch_kernel_bool_boolean_algebra_inhabits`).
/// **Dissolution:** remove this patch once v2 accepts `inhabits` on sum types in
/// `dsl/` (then express `type Bool inhabits BooleanAlgebra<Bool> = True | False`
/// in `dsl/std/types.dag` and delete this helper).
#[cfg_attr(not(feature = "bootstrap-regen-fresh"), allow(dead_code))]
pub(crate) fn patch_kernel_bool_boolean_algebra_inhabits(dag: &mut Dag) {
// Audit row #2 retirement (bootstrap.rs slice 1 of 2):
Expand Down
Loading
Loading