✓
Passing Passing: the compiler rejects this program as expected.
Code
// TEST: the dropped session is VISIBLE to enforcement even when nobody will
// insert the hang-up for you.
//
// `create` mints `*Bridge<session!>`; only `close`, taking `<!session>`,
// discharges it. This flow opens a session, asks it a question, and walks away.
//
// In the DEFAULT mode that program compiles, because `close` is void and
// auto-discharge appends it — which is the guarantee working, not a hole, and
// `440_006` is the positive half. `--auto-discharge=disable` opts out of
// INSERTING a discharger; it never opts out of the obligation being SEEN. So
// the same program under the flag must still be refused by name.
//
// That distinction is the whole reason this test carries a flag: without it,
// making a disposer auto-insertable would silently retire the wall along with
// the chore.
import std/bridge
import std/io
[with]std/bridge:create(id: "s1", scope: "files"): br |> get-handles(br): n |> std/io:print.ln("holding {{ n:d }}")
Actual compiler output
error[KORU030]: Resource 'br' carries obligation <session!> was not discharged. Call: std.bridge:close
--> tests/regression/400_RUNTIME_FEATURES/440_RESOURCE_BRIDGE/440_005_bridge_session_cannot_be_dropped/input.k:19:0
❌ Compiler coordination error: Phantom semantic validation failed
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must contain:
obligation <session!> was not dischargedFlows
flow ~create click a branch to expand · @labels scroll to their anchor
create (id: "s1", scope: "files")
Test Configuration
MUST_ERROR
Compiler Flags:
--auto-discharge=disable