test(joinir): Phase 129 P2 - add post-if return var fixture + VM smoke

- Add phase129_if_only_post_if_return_var_min.hako
  - Pattern: x=1; if flag==1 { x=2 }; print(x)
  - Tests join_k continuation env merge

- Add phase129_if_only_post_if_return_var_vm.sh
  - Expected output: 2 (x updated in then branch)
  - Dev-only: NYASH_JOINIR_DEV=1 HAKO_JOINIR_STRICT=1

Note: Currently passes via fallback path (non-Normalized)
P1 implementation (join_k materialization) is next step
This commit is contained in:
nyash-codex
2025-12-18 07:18:00 +09:00
parent e7ad3d31ba
commit 083be99214
3 changed files with 278 additions and 0 deletions

View File

@ -0,0 +1,22 @@
// Phase 129: if-only post-if return var (Normalized join_k continuation)
// Pattern: x=1; if flag==1 { x=2 }; return x
// Expected: x=2 (flag=1 fixed)
//
// This tests that join_k continuation properly merges env:
// - then: x=2 (updated)
// - else: x=1 (original)
// - join_k: receives env_phi and continues to return x
static box Main {
main() {
local x
local flag
x = 1
flag = 1
if flag == 1 {
x = 2
}
print(x)
return "OK"
}
}