✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 696_001_ctx_scope_injection: `std/ctx` scope attach (the
// std/ctx:default transform) relocated into an imported module.
//
// ctx splices out at comptime by reading the named store's fields — the
// store and the scoped flow both living in the module is the boundary
// position this mirror exists to pin.
import app/lib
app/lib:run()
Supporting Files
import std/io
import std/store
import std/ctx
std/store:new(outer) { a: 1[i64], b: 2[i64], c: 3[i64] }
pub tor ctxprobe { a: i64, b: i64, c: i64 }
ctxprobe = std/io:print.ln("ctxprobe a={{ a:d }} b={{ b:d }} c={{ c:d }}")
pub tor run {}
run = std/io:print.ln("seed")
|> std/ctx(outer) |> ctxprobe()
|> ctxprobe(b: 42)
Actual
seed
ctxprobe a=1 b=2 c=3
ctxprobe a=1 b=42 c=3
Expected output
seed
ctxprobe a=1 b=2 c=3
ctxprobe a=1 b=42 c=3
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN