Typeck Inference Completeness: Empty-Container Phase-Contract + Body-Inference Gaps + Dispatch + Fallback

12 sections

81%
Overview

Close the typeck inference completeness gap end-to-end so the test suite reaches failed: 0 via localized compiler fixes, never by mechanical test annotation. The plan began as "empty-container typeck phase-contract enforcement" (BUG-04-074) and expanded when §06.2C investigation (2026-04-23) revealed the remaining 28-file E2005 ledger was not one "polymorphic-constructor class" but seven distinct typeck gaps sharing only the E2005 symptom. Deliver all gap fixes as ONE coherent system:

In Progress

5 sections

Planned

1 sections

Completed

6 sections
Section 1 Complete

AST-based Value Restriction

Extract a two-helper SSOT (`should_generalize` policy decision + `maybe_generalize` apply-the-decision) and migrate all 3 let-generalization sites to call `maybe_generalize`, so only direct non-capturing lambda initializers generalize — all other initializers (empty lists, block-wrapped lambdas, variable aliases, conditionals producing functions, capturing lambdas via any ExprKind child position) become monomorphic. `body_captures_outer` carries `_ => true` conservative default so unknown ExprKind shapes default to capture (soundness direction).

58/58 tasks
Section 2 Complete

Validator Module — validate_body_types()

>

53/53 tasks
Section 3 Complete

Bodies-Pass Integration

>

46/46 tasks
Section 4 Complete

Codegen Defense-in-Depth Assertions

Insert an `assert_no_unresolved_type_vars` call at the single upstream codegen seam (`ori_llvm::function_compiler::process_arc_function` + the lambda counterpart in `declare_and_process_lambda`) so that any `Tag::Var` surviving the typeck → ARC → codegen boundary is caught immediately with a typed error, a clear diagnostic, and integration with the existing `ORI_VERIFY_ARC` plumbing — NOT a collection of 4 fragile consumer-site hooks that bypass the seam. A small number of secondary pre-seam hooks (at the 4 monomorphization entry points) remain ONLY to localize the diagnostic to the pre-realization IR; the load-bearing gate is the seam hook.

111/111 tasks
Section 5 Complete

Test Matrix + Semantic Pins

>

52/52 tasks
Section 8 Complete

Codegen Poly-Lambda Monomorphization (absorbs BUG-04-042)

>

179/179 tasks