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>
This commit is contained in:
7
apps/tests/stage1_run_min.hako
Normal file
7
apps/tests/stage1_run_min.hako
Normal file
@ -0,0 +1,7 @@
|
||||
// Minimal run path fixture for Stage‑1 CLI.
|
||||
// Produces a trivial Program(JSON v0) with Main.main returning 0.
|
||||
static box Main {
|
||||
static method main() {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user