Files
hakorune/docs/development/current/main/design
nyash-codex d3b3bf5372 feat(mir): Phase 131-11-E - TypeFacts/TypeDemands 分離(SSOT)
## 実装内容

### 1) Rust MIR Builder (ops.rs + lifecycle.rs)
- OperandTypeClass で型分類(String/Integer/Unknown)
- BinOp 型推論: Integer + Unknown → Integer
- lifecycle.rs に repropagate_binop_types() パス追加
  - PHI 型解決後に BinOp 型を再計算

### 2) JSON Emission (mir_json_emit.rs)
- 結果ベースの dst_type 発行に変更
- Integer → "i64", String → {kind: handle, box_type: StringBox}

### 3) Python LLVM Backend (binop.py)
- dst_type を確実な情報として使用
- dst_type != None なら優先して処理

## 結果
-  MIR: PHI/BinOp が Integer として正しく型付け
-  VM: `Result: 3` (正しい出力)
-  JSON: `dst_type: "i64"` を発行
-  LLVM: 別の codegen 問題の可能性あり

## SSOT 設計達成
- TypeFacts(事実): 定義命令から推論
- TypeDemands(要求): 使用箇所の coercion で吸収
- 後方伝播なし: Fail-Fast に統一

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-14 18:55:05 +09:00
..

design/

docs/development/current/main/design/ は、長期参照する設計図SSOT 寄り)を置く場所。

  • 原則: “Phaseの作業ログ/完了報告” は ../phases/ に置く。
  • 原則: “不具合調査ログ” は ../investigations/ に置く。