✓
Passing This code compiles and runs correctly.
Code
// A guard expression on the reference reactive-attach fuses into the producer,
// exactly as it does for a classic guarded watch (690_002) — the reference form
// inherits the whole guard-fusion machinery. Here the rule fires only on writes
// where `hp < 10`; the guard is checked at the write site, not by a runtime
// filter.
import std/io
import std/store
std/store:new(game) { hp: 0[i64] }
std/store(game)
! hp h when h < 10 |> std/io:print.ln("Low hp {{ h:d }}")
std/store:stored { game.hp: 5 }
std/store:stored { game.hp: 15 }
std/store:stored { game.hp: 3 }
Actual
Low hp 5
Low hp 3
Expected output
Low hp 5
Low hp 3
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: game, source: hp: 0[i64])
flow ~std/store click a branch to expand · @labels scroll to their anchor
std/store (game)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: game.hp: 5)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: game.hp: 15)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: game.hp: 3)
Test Configuration
MUST_RUN