refactor(mir): Extract TypeFacts Box from ops.rs (Phase 136 follow-up 1/3)

## Summary
Extracts type inference logic from ops.rs into independent TypeFacts Box,
improving testability and responsibility separation.

## Changes
- New file: src/mir/builder/type_facts.rs (TypeFactsBox + OperandTypeClass)
- Modified: src/mir/builder/ops.rs - Use TypeFacts Box instead of method
- Modified: src/mir/builder.rs - Add type_facts module

## Effect
- Type inference logic is now independently testable
- ops.rs responsibility simplified to "operator lowering only"
- Enables future sharing with lifecycle.rs:repropagate_binop_types()

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
nyash-codex
2025-12-15 19:49:41 +09:00
parent 455d511187
commit 47d6f50e96
3 changed files with 97 additions and 41 deletions

View File

@ -52,6 +52,7 @@ mod router; // RouterPolicyBoxUnified vs BoxCall
mod schedule; // BlockScheduleBox物理順序: PHI→materialize→body
mod ssa; // LocalSSA helpers (in-block materialization)
mod stmts;
mod type_facts; // Phase 136 follow-up: Type inference facts box
pub(crate) mod type_registry;
mod types; // types::annotation / inference型注釈/推論の箱: 推論は後段)
mod utils;