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:
22
apps/tests/phase129_if_only_post_if_return_var_min.hako
Normal file
22
apps/tests/phase129_if_only_post_if_return_var_min.hako
Normal 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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user