Phase 8.8: Pack transparency system core implementation completed

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-15 10:52:35 +00:00
parent 6b62209da9
commit 8dfa9a50b5
6 changed files with 235 additions and 48 deletions

View File

@ -0,0 +1,40 @@
# 🔥 Phase 8.8: pack透明化システム 基本テスト
# ユーザーは`pack`を一切意識せず、`from BuiltinBox()`で自動動作
print("=== pack透明化システム基本テスト開始 ===")
# テストA: ユーザー定義Box基本動作 (birth優先)
box Life {
init { name, energy }
birth(lifeName) {
me.name = lifeName
me.energy = 100
}
introduce() {
return "私の名前は " + me.name + " です。"
}
}
local alice = new Life("Alice")
print("A. " + alice.introduce())
# テストB: 透明化システム動作 - 最重要テスト
box SimpleString from StringBox {
init { prefix }
birth(content, prefixStr) {
from StringBox(content) # ← 透明化内部的にpack呼び出し
me.prefix = prefixStr
}
getMessage() {
return me.prefix + "test message"
}
}
local simple = new SimpleString("World", "<<< ")
print("B. " + simple.getMessage())
print("=== pack透明化システム基本テスト完了 ===")