Files
hakorune/apps/tests/phase263_p0_pattern2_seg_min.hako
tomoaki 9d71a3b1a4 test(phase263): add minimal repro for Pattern2 LoopBodyLocal seg issue
- apps/tests/phase263_p0_pattern2_seg_min.hako: loop body で seg 代入
- tools/.../phase263_p0_pattern2_seg_vm.sh: VM smoke test
- 現状: Pattern2 rejection で FAIL(固定)
- 期待: 修正後に Pattern1 fallback で PASS
2025-12-21 09:54:39 +09:00

36 lines
736 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Phase 263 P0: Pattern2 LoopBodyLocal "seg" 問題の最小再現テスト
//
// 目的:
// - loop body で代入される seg 変数を Pattern2 が promote しようとして失敗する
// - 現状: Pattern2 rejection で FAIL
// - 期待: 修正後に Pattern1 fallback で PASS
static box Main {
main() {
local result = parse_segments()
return 0
}
}
// Pattern2 が検出するループ構造
method parse_segments() {
local i = 0
local seg = ""
loop(i < 5) {
seg = get_segment(i) // ← loop body で代入ReadOnlySlot 契約違反)
if seg == "end" {
break
}
i = i + 1
}
return i
}
method get_segment(idx) {
return "seg"
}