Files
hakorune/docs/development/runtime
nyash-codex a13f14cea0 feat(mir): Phase 21.7 Step 1-2 - NamingBox decode & Hotfix 7修正
## 実装内容

### Step 1: NamingBox decode関数追加 (naming.rs)
-  `decode_static_method(func_name) -> Option<(box, method, arity)>`
-  `is_static_method_name(func_name) -> bool`
- 対称性: encode ⇔ decode のペア実装で一貫性確保

### Step 2: unified_emitter Hotfix 7修正 (Lines 267-304)
-  StaticCompiler box kind判定追加
-  static box method は receiver 追加をスキップ
-  instance method(RuntimeData/UserDefined)のみ receiver 追加
-  トレース: NYASH_STATIC_METHOD_TRACE=1 でログ出力

## 判定ロジック
```rust
if box_kind == CalleeBoxKind::StaticCompiler {
    // "BoxName.method/arity" 形式か確認
    let func_name = format!("{}.{}/{}", box_name, method, args.len());
    if is_static_method_name(&func_name) {
        // static box method → receiver 追加しない
    }
}
```

## 検証
 Stage-1 テスト: RC=0 (apps/tests/stage1_skip_ws_repro.hako)
 ビルド成功(0 error)

## 次のステップ
- Step 3: methodization実装 (HAKO_MIR_BUILDER_METHODIZE=1)

Co-Authored-By: ChatGPT5 <chatgpt@openai.com>
2025-11-21 23:52:10 +09:00
..