feat(joinir): Phase 65-2-A StringBox メソッド型ヒント実装
Phase 65-2-A 完了:P3-A(StringBox メソッド)型ヒント実装 ## 実装内容 ### 1. type_inference.rs 新規作成 - `infer_method_return_type()`: StringBox/ArrayBox/MapBox メソッド型推論 - `infer_box_type()`: Box コンストラクタ型推論(Phase 65-2-B 用) - 8 テスト全て PASS ### 2. JoinInst::MethodCall に type_hint 追加 - `src/mir/join_ir/mod.rs`: `type_hint: Option<MirType>` フィールド追加 - 段階的拡大のため Optional 設計(既存コード破壊なし) ### 3. read_quoted.rs で型ヒント設定 - substring() → String(4箇所) - length() → Integer(1箇所) - read_quoted 系関数で完全な型ヒント供給 ### 4. 汎用経路は None で後方互換性維持 - expr.rs: 汎用 MethodCall は `type_hint: None` - convert.rs: 型ヒント追加(Phase 65-3 で活用予定) - json.rs: JSON シリアライズ対応 ## テスト結果 - ✅ type_inference モジュール: 8/8 PASS - ✅ ビルド: 0 エラー ## 次のステップ - Phase 65-2-B: Box コンストラクタ型ヒント実装 --- 🌟 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -204,6 +204,7 @@ pub(crate) fn convert_join_function_to_mir(
|
||||
receiver,
|
||||
method,
|
||||
args,
|
||||
type_hint, // Phase 65-2-A: 型ヒント追加(現状は無視、Phase 65-3 で活用)
|
||||
} => {
|
||||
// Phase 34-6: MethodCall → MIR BoxCall 変換
|
||||
// receiver.method(args...) を BoxCall(receiver, method, args) に変換
|
||||
@ -216,6 +217,9 @@ pub(crate) fn convert_join_function_to_mir(
|
||||
effects: EffectMask::PURE,
|
||||
};
|
||||
current_instructions.push(mir_inst);
|
||||
|
||||
// Phase 65-2-A: TODO: type_hint を value_types に記録する処理を Phase 65-3 で追加
|
||||
let _ = type_hint; // 現状は unused warning 回避
|
||||
}
|
||||
// Phase 56: ConditionalMethodCall → MIR (cond ? method : no-op)
|
||||
JoinInst::ConditionalMethodCall {
|
||||
|
||||
Reference in New Issue
Block a user