docs: clarify static box method arity (implicit self) and plan fix in Phase 20.33; expand Bridge singleton injection spec; update checklist

This commit is contained in:
nyash-codex
2025-11-01 07:07:29 +09:00
parent eabeb69d77
commit a87ea2636c
3 changed files with 15 additions and 0 deletions

View File

@ -132,6 +132,12 @@ static box Main {
}
```
注意静的Boxのメソッド引数規約
- 静的Boxのメソッドは先頭に暗黙の `self`= Singletonが存在する。
- つまり呼び出し側は `Main.main()` のように書いても、意味論上は `Main.main(self, ...)` の形になる。
- VM/MIR/LLVM いずれのバックエンドでも、この規約に基づき引数個数arityを判定する。
- 開発時のガイドライン: 静的Box内に定義する全メソッドは「先頭に `self` を取る」形で設計すること(将来の最適化や検証で一貫性を保つため)。
### **2.2 変数宣言**
#### **基本パターン**