✓
Passing This code compiles and runs correctly.
Code
// PINS: a declined `?!` panic branch is LOUD from inside an arm, not only at
// the top level of a flow.
//
// `?!` exists to mean "unsafe to ignore": a consumer may decline to write the
// arm, and the compiler synthesizes a loud one so the path cannot silently
// proceed. 355_009 pins that a plain `?` optional stays silent, which is the
// deliberate contrast.
//
// Both takes below decline `| empty` — the first at flow top level, the
// second nested inside the `for` arm's body. Synthesis descends into arm
// continuations, so the nested decline gets the same synthesized @panic:
// the second take's `| empty` fire traps (EXPECT_TRAP) instead of reaching
// the final print. This pin was RED when written (a538e98c3) and went green
// when the synthesis learned to descend (00341d7c4).
import std/io
import std/store
import std/control
std/store:new(log) { h: -1[i64] }
std/store:new(rows, capacity: 4) { v: i64 }
std/store:insert(rows) { v: 42 }
| row r |> std/store:stored { log.h: r }
| full |> _
std/store:take(rows[log.h])
| item first |> std/io:print.ln("first take: {{ first.v:d }}")
// The same declined branch, one level in. The row is already gone, so `| empty`
// is the only outcome this call can produce.
for(0..1)
! each _ |> std/store:take(rows[log.h])
| item second |> std/io:print.ln("SECOND TAKE RETURNED A ROW: {{ second.v:d }}")
std/io:print.ln("REACHED THE END — the declined panic branch was silent")
Actual
first take: 42
thread 11671558 panic: input:__store_take_rows: unhandled panic branch 'empty' fired at runtime
???:?:?: 0x10084db17 in _output_emitted.main_module.flow2 (???)
???:?:?: 0x10084d75f in _output_emitted.main (???)
???:?:?: 0x10084d66b in _main (???)
???:?:?: 0x18073fdff in ??? (???)
???:?:?: 0x0 in ??? (???)
Expected patterns
Each line is a regex that must match the program output.
first take: 42
unhandled panic branch 'empty' fired at runtimeFlows
flow ~new click a branch to expand · @labels scroll to their anchor
new (log, source: h: -1[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (rows, capacity: 4, source: v: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (rows, source: v: 42)
flow ~take click a branch to expand · @labels scroll to their anchor
take (h]: rows[log.h])
flow ~for click a branch to expand · @labels scroll to their anchor
for (0..1)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "REACHED THE END — the declined panic branch was silent")
Test Configuration
MUST_RUN EXPECT_TRAP · exit 134