✓
Passing Passing: the compiler rejects this program as expected.
Code
// 696_012 — std/ctx: a name present only with a misfitting type does not
// inject. inner.a is f64; the callee wants a: i64 and no scope provides a
// compatible `a`.
//
// PINS the refusal tail of typed matching: the mistyped column is skipped
// (not injected, not coerced), the param stays unfilled, and the call
// refuses through the ordinary missing-input path — ctx adds no new
// error path.
import std/io
import std/store
import std/ctx
std/store:new(inner) { a: 1.5[f64] }
pub tor want-int { a: i64 }
want-int = std/io:print.ln("unreached")
std/io:print.ln("seed")
|> std/ctx(inner) |> want-int()
Actual compiler output
error[KORU080]: 'want-int' requires input 'a' — it is declared with no default and no `?`, and this call does not supply it
--> tests/regression/600_STDLIB/696_CTX/696_012_ctx_typed_refusal/input.k:20:0Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (inner, source: a: 1.5[f64])
subflow ~want-int click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreached")
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "seed")
Test Configuration
MUST_ERROR