✓
Passing This code compiles and runs correctly.
Code
// Test: the set reaches the SECOND consumer, which builds its insert
// guard through the shared predicate — and whose AST arrives by
// serialization, so this also pins that a set survives program.ast.json.
// `a.mode: 2` commits; `a.mode: 9` is a non-member and produces into the
// branch carrying the column spelling.
//
// Expected: runs clean — `committed` then `rejected a.mode`.
import std/proto
import std/refine
import std/store
import std/io
std/proto:i64(Mode)
std/proto(Sample) {
mode: Mode
}
std/refine(Sample) {
mode: Mode & 1 | 2 | 3
}
std/store:new(reg, capacity: 4) { a: Sample }
std/store:insert(reg) { a.mode: 2 }
| row r |> std/io:print.ln("committed")
std/store:insert(reg) { a.mode: 9 }
| violated f |> std/io:print.ln("rejected {{ f:s }}")
Actual
committed
rejected a.mode
Expected output
committed
rejected a.mode
Flows
flow ~i64 click a branch to expand · @labels scroll to their anchor
i64 (expr: Mode)
flow ~std/proto click a branch to expand · @labels scroll to their anchor
std/proto (Sample, source: mode: Mode)
flow ~std/refine click a branch to expand · @labels scroll to their anchor
std/refine (Sample, source: mode: Mode & 1 | 2 | 3)
flow ~new click a branch to expand · @labels scroll to their anchor
new (reg, capacity: 4, source: a: Sample)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (reg, source: a.mode: 2)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (reg, source: a.mode: 9)
Test Configuration
MUST_RUN