✓
Passing Passing: the compiler rejects this program as expected.
Code
// Test (negative): a `[]const u8<unsanitized!>` value passed into any event
// that doesn't accept `<!unsanitized>` is rejected by the phantom checker.
//
// This is the taint-tracking shape: a tainted string flowing into a sink
// (like `std/io:print.ln`) without going through a sanitizer is a
// compile-time error. The phantom checker treats the obligation on the
// primitive payload exactly as it treats `*File<opened!>` — undischarged
// at scope exit is a rejection.
//
// Positive twin: 330_068.
import std/io
pub tor get-input {} -> string<unsanitized!>
get-input -> "user input data"
get-input(): s |> std/io:print.ln(s)
Actual compiler output
error[KORU030]: Resource 's' obligation <unsanitized!> was not discharged. No tor accepts <!unsanitized>.
--> tests/regression/300_ADVANCED_FEATURES/330_PHANTOM_TYPES/330_069_reject_undischarged_string_obligation/input.k:18:0
❌ Compiler coordination error: Auto-discharge failed (multiple disposal options or no disposal event)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Must fail at runtime:
Program must error when executed.
Error output must contain
Resource 's' obligation <unsanitized!> was not discharged. No tor accepts <!unsanitized>.Flows
flow ~get-input click a branch to expand · @labels scroll to their anchor
get-input
Test Configuration
MUST_ERROR