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
Generic declaration validation rejects private types from its own module #1130
Specification §18.3 makes unexported names module-private. A generic declaration must be able to refer to private types in its own module.
Minimal reproduction, lib/hidden.w:
type Entry[T] { value: T }
pub type Container[T] { entry: *mut Entry[T] }
main.w:
use hidden
fn main: print("ok")
with check --prelude=core main.w should succeed. It instead reports unknown type 'Entry', suggests Entry, and attributes the declaration error to the importing main file.
Native LLDB stops at Sema.emit_unknown_type_error from Sema.validate_type_expr_with_impl_type_params, then Sema.validate_generic_type_decls. In src/SemaDecl.w:2957, the declaration-validation loop visits each generic type without installing that declaration's source context before the visibility check at line 2782. This differs from ordinary declaration/body checking through update_decl_source_context.
Found while implementing an owning c-algorithms heap facade with a private generic node type. No workaround: the node stays private. Fix and regression coverage are being prepared in the Phase 1 branch, including checking that the private type remains inaccessible from the importer.
Activity
stdlib sourcing Phase 1: the c-algorithms corpus, its upstream tests,…
C algorithms phase1 (#1142)
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): does not reproduce.