ReviewOS

home-lang/home

fix(codegen): restore TypeInferencer integration after checker consolidation

#822
Closed glennmichael123 opened this 8 days ago ·
8 days ago

Problem

The committed codegen test target does not compile on current main. packages/codegen/src/type_integration.zig aliases type_system.TypeInferencer, but packages/types/src/type_system.zig no longer exports that symbol; the implementation lives in packages/types/src/type_inference.zig.

Reproduction

Run under the repository guard:

zig build test -Dfilter=codegen -j1 --summary all

Current failure:

packages/codegen/src/type_integration.zig:5:35: error: root source file struct type_system has no member named TypeInferencer

This reproduces from committed HEAD; the working tree only contained an unrelated parser full-slice change when it was observed. Peak guarded footprint before the compile error was 132 MB.

Scope

  • Restore a deliberate import/export boundary for the inferencer, or remove the stale integration if the authoritative checker supersedes it.
  • Keep one semantic authority; do not recreate the deleted duplicate checker.
  • Make the codegen test target compile and pass.

Acceptance

  • zig build test -Dfilter=codegen -j1 --summary all passes under the memory guard.
  • Add or preserve a regression that exercises the integration path.
  • Document whether codegen consumes type_inference.zig or the authoritative TypeChecker.

Related to #801. Surfaced while verifying #779; not caused by its parser change.

8 days ago

Fixed on origin/main by daa91ed0b. The unwired TypeIntegration bridge and its unregistered stale tests were removed; NativeCodegen no longer exposes a second HM inference entry point; and MoveChecker preserves its existing conservative unknown-type behavior without depending on an inferencer it was never given. The package README now records packages/types/src/type_system.zig as the semantic authority. Guarded verification: zig build test -Dfilter=codegen -j1 --summary all passes 16/16 at 420 MB peak; scoped Pickier and git diff --check pass. Five files changed exactly.

Sign in to comment on this issue.