feat(plugin): Fix plugin BoxRef return and Box argument support
- Fixed deadlock in FileBox plugin copyFrom implementation (single lock) - Added TLV Handle (tag=8) parsing in calls.rs for returned BoxRefs - Improved plugin loader with config path consistency and detailed logging - Fixed loader routing for proper Handle type_id/fini_method_id resolution - Added detailed logging for TLV encoding/decoding in plugin_loader_v2 Test docs/examples/plugin_boxref_return.nyash now works correctly: - cloneSelf() returns FileBox Handle properly - copyFrom(Box) accepts plugin Box arguments - Both FileBox instances close and fini correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
# Phase 5.2: Lowering for static box Main (BoxDeclaration → main body)
|
||||
|
||||
Summary:
|
||||
- static box Main { main() { ... } } を MirBuilder で受け、main() の body を Program として lowering する経路を実装します。
|
||||
- 目的は `--dump-mir` が static Main 形式のサンプルでも通り、VM 実行にも到達すること。
|
||||
|
||||
Scope:
|
||||
- AST: BoxDeclaration(is_static=true, name=Main) を検出 → 同名 main() を探して Program 化
|
||||
- Lowering: 発見した body を既存の Program lowering に渡す(関数単位でOK)
|
||||
- Tests: local_tests/mir_loop_no_local.nyash(static Main)で dump/VM が通る
|
||||
|
||||
Tasks:
|
||||
- [ ] MirBuilder: static Main → Program lowering 経路
|
||||
- [ ] MirPrinter/Verifier: 必要なら修正
|
||||
- [ ] サンプル/スナップショットの点検
|
||||
|
||||
Acceptance Criteria:
|
||||
- `nyash --dump-mir ./local_tests/mir_loop_no_local.nyash` が成功
|
||||
- `nyash --backend vm ./local_tests/mir_loop_no_local.nyash` が成功
|
||||
|
||||
References:
|
||||
- #33, #35
|
||||
- docs/guides/how-to-build-native/copilot_issues.txt
|
||||
|
||||
Reference in New Issue
Block a user