✓
Passing Passing: the compiler rejects this program as expected.
Code
// The same peel without the discharge: the destructured field's obligation
// is now a named debt — the exit check refuses it, where the discard-keyed
// `_.data` debt used to slip past the compiler and leak at runtime.
import std/io
import std/compress
std/compress:gzip(data: "hello koru")
| error e |> std/io:print.ln("ERR {{ e:s }}")
| compressed { data }
|> std/io:print.ln("{{ data:s }}")
Actual compiler output
error[KORU030]: Resource 'data' carries obligation <allocated!> was not discharged. Call: std/io:free
--> tests/regression/300_ADVANCED_FEATURES/335_OBLIGATION_STRESS/335_058_destructured_field_leaks/input.k:9:1Must contain:
KORU030Flows
flow ~gzip click a branch to expand · @labels scroll to their anchor
gzip (data: "hello koru")
Test Configuration
MUST_ERROR LANGUAGES: zig