Phase 263 P0: Pattern2 で処理できない LoopBodyLocal を検出したら Pattern2 全体を早期終了 Changes: - promote_step_box.rs: 戻り値を Result<Option<_>, String> に変更 - Reject を二分化: 対象外(not_readonly等)→ Ok(None)、対象だが未対応 → Err - pattern2_lowering_orchestrator.rs: Ok(None) 検出で早期 return - apps/tests/phase263_p0_pattern2_seg_min.hako: test simplification 後続経路(legacy binding等)へ fallback させる(detection→extract→lower SSOT 維持) Fail-Fast 原則: 対象外は Ok(None) で後続経路へ、対象だが未対応は Err で即座に失敗 Fixes: core_direct_array_oob_set_rc_vm smoke test FAIL 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 lines
596 B
Plaintext
26 lines
596 B
Plaintext
// Phase 263 P0: Pattern2 LoopBodyLocal "seg" 問題の最小再現テスト
|
||
//
|
||
// 目的:
|
||
// - loop body で代入される seg 変数を Pattern2 が promote しようとして失敗する
|
||
// - 現状: Pattern2 rejection で FAIL
|
||
// - 期待: 修正後に Pattern1 fallback で PASS
|
||
|
||
static box Main {
|
||
main() {
|
||
local i = 0
|
||
local seg = ""
|
||
|
||
loop(i < 5) {
|
||
seg = "segment" // ← loop body で代入(ReadOnlySlot 契約違反)
|
||
|
||
if seg == "end" {
|
||
break
|
||
}
|
||
|
||
i = i + 1
|
||
}
|
||
|
||
return 0
|
||
}
|
||
}
|