You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A module under lib/std/<parent>/ cannot see a corpus pub let through use; generic types need item imports #1136
Two visibility gaps for a stdlib module placed under a parent module directory (lib/std/collections/binary_heap.w, imported as std.collections.binary_heap; the parent lib/std/collections.w exists and is prelude-imported):
use std.c_algorithms.defs (a whole-module import) does not make the corpus's pub let BINARY_HEAP_TYPE_MAX: c_uint = 1 visible: error: undefined variable. The item import use std.c_algorithms.defs.BINARY_HEAP_TYPE_MAX does not either. The identical file copied to lib/std/binary_heap_probe.w (top level) checks clean, and a user program at the project root sees the global through both spellings.
use std.collections.engine_slot (whole-module) does not bring the generic type pub type Slot[T] { ... } into scope (unknown type 'Slot') while the same import does bring the module's functions (slot_compare); the item import use std.collections.engine_slot.Slot works. Non-generic types from std.c_algorithms.defs (_SortedArray, c_uint) resolve through the whole-module import in the same file.
Repro: the c-algorithms-phase1 worktree, out/bootstrap/bin/with-stage1 check lib/std/collections/binary_heap.w with the globals spelled as in lib/std/c_algorithms/defs.w. The facades currently spell the heap type as a local constant and import Slot by item as the workaround; remove both when this is fixed.
Spec: §18 module imports (a whole-module use brings every pub item of the module).
No longer reproduces (main 23dd9db): a module under lib/std/collections/ importing std.engines.c_algorithms.defs and std.collections.engine_slot through whole-module uses sees the corpus pub let and the generic type. #2614 removed BinaryHeap's workaround (the local HEAP_TYPE_* constants); the facade reading BINARY_HEAP_TYPE_MIN/MAX is the standing regression test since std compiles in every battery.
Activity
stdlib sourcing Phase 1: the c-algorithms corpus, its upstream tests,…
C algorithms phase1 (#1142)
docs: stdlib_sourcing_plan reflects the implemented state (all four p…
Stdlib sourcing close-out: Stack/Queue/LinkedList, stable_sort/shuffl…
ehartford commentedon Oct 24, 2026
No longer reproduces (main 23dd9db): a module under lib/std/collections/ importing std.engines.c_algorithms.defs and std.collections.engine_slot through whole-module uses sees the corpus pub let and the generic type. #2614 removed BinaryHeap's workaround (the local HEAP_TYPE_* constants); the facade reading BINARY_HEAP_TYPE_MIN/MAX is the standing regression test since std compiles in every battery.