ReviewOS

home-lang/home

fix(types): expose exported bindings through imported namespaces

#827
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Exported module constants are parsed as private LetDecl nodes. The parser applies export visibility to functions but only applies pub visibility to let/const/var/static declarations, so TypeChecker.processImport omits valid export const members from namespace structs.\n\nThis produces false missing-field errors for current home-os constants such as acpi.AML_TEST_CHECKS, aml.AML_INTERP_CHECKS, foundation.FLOAT_TEST_CHECKS, and devfs.DEV_TYPE_BLOCK.\n\nScope:\n- make export bindings public to Home module consumers\n- preserve private binding hiding\n- add parser and import-namespace regressions\n- remeasure the current home-os origin/main corpus\n\nTracks #787 and #66.

9 days ago

Implemented and pushed directly to main in 5af74c0. Export visibility now applies consistently to let/const/var/static bindings, so imported namespace structs include exported constants while private members remain hidden. Verification: parser 149/149, checker 70/70, guarded no-JSC build at 2,774 MB peak, and the current archived home-os origin/main corpus improved from 21 to 17 semantic failures, removing all four observed exported-constant missing-field errors. Exactly four files; Glenn author/committer; no coauthors.

Sign in to comment on this issue.