✓
Passing This code compiles and runs correctly.
Code
// A `.k` contract and its `.kz` implementation are ONE module.
//
// `compute` is declared ONLY in contract.k. The proc implementing it lives
// ONLY in contract.kz. For this call site to resolve, the resolver must load
// every companion sharing the stem `contract`, not stop at the first hit its
// extension probe order reaches.
//
// That matters beyond this test: a program whose Koru and Zig share one file
// must write `` on every Koru line, because the parser really is sitting in
// the host language. Split along this seam and the declarative half has no
// host language in it, so the character is not needed anywhere in it.
const std = @import("std");
~import std/io
~import app/contract
~app/contract:compute(x: 42): v |> std/io:print.ln("{{ v:d }}")
Actual
142
Must succeed:
Compile and run without errors.
Expected output
142
Flows
flow ~compute click a branch to expand · @labels scroll to their anchor
compute (x: 42)
Imported Files
// The implementation facet: the proc body only. The event it implements is
// declared in the sibling contract.k, and the resolver must load BOTH files
// into the module for this proc to have anything to attach to.
//
// `compute` has a bare return (`-> u32`), so the proc returns the value
// itself — a branch constructor would name an outcome the signature does not
// declare.
const std = @import("std");
~proc compute|zig {
return x + 100;
}
Test Configuration
MUST_RUN