✓
Passing Passing: the compiler rejects this program as expected.
Code
// consume-once: the second dispose is a use-after-consume — the obligation
// checker's wall, not the lane's.
import std/io
import std/tree
std/tree:node(Node) { item: i64 }
std/tree:mint(Node) { item: 1 }: n
|> std/tree:dispose(n): _
|> std/tree:dispose(n): _
|> std/io:print.ln("unreachable")
Actual compiler output
error[KORU030]: Use-after-discharge: binding 'n' was already discharged and cannot be used
--> tests/regression/600_STDLIB/682_TREE/682_008_double_dispose_refused/input.k:11:1Must contain:
Use-after-dischargeFlows
flow ~node click a branch to expand · @labels scroll to their anchor
node (Node, source: item: i64)
flow ~mint click a branch to expand · @labels scroll to their anchor
mint (Node, source: item: 1)
Test Configuration
MUST_ERROR