Problem
A PatternChecker is allocated and freed by the type checker but never invoked. Codegen's strict-exhaustiveness switch defaults to off and nothing enables it, so an unhandled enum variant silently evaluates to 0 at runtime. The Home-only diagnostic HM2000 exists for exactly this and is never emitted.
Evidence (origin/main @ d4b219507)
packages/types/src/type_system.zig:859packages/types/src/type_system.zig:900packages/types/src/type_system.zig:947packages/types/src/pattern_checker.zig:36packages/types/src/pattern_checker.zig:207packages/types/src/pattern_checker.zig:262packages/codegen/src/native_codegen.zig:740packages/codegen/src/native_codegen.zig:1576-1593packages/ts_diagnostics/src/ts_diagnostics.zig:324
Scope
- Call the pattern checker for every
matchand emitHM2000for non-exhaustive matches. - Require all arms to agree on a result type (join/LUB).
- Remove the codegen fallback that yields 0 for an unmatched value.
Acceptance criteria
- A non-exhaustive
matchon an enum / bool / Result is a checker error. - Arms with incompatible result types are an error.
- Negative tests plus a runtime test that no unmatched path exists.