✓
Passing This code compiles and runs correctly.
Code
// RED PIN, MUST_ERROR (type-system design walk, 2026-07-06/07).
// Binding types checked at the KORU layer against registry entries.
// Today a bind's or branch payload's type is a string the checker can
// pattern-match but not reason about — the true rejection happens in
// Zig, in Zig's voice, pointing at generated code (Lars, 2026-07-06:
// "loosely checked against the translated Koru layer and then rejected
// fully in the Zig layer"). With declared types in the registry, the
// flow/shape checkers resolve binding types and reject HERE, with a
// koru diagnostic naming both declared types.
//
// The reference for the diagnosis is already on the shelf: the phantom
// checker rejects a value bound as one phantom state and passed as
// another (`feet!` bound, handed to a `meters!` param) — same-shape,
// distinct-identity, koru-led (frag-bare-phantom-resolves-to-base-type-
// module). This pin is the same check, at the level of DECLARED TYPE
// identity: Meters and Feet are two registry entries and one shape, and
// a Meters value handed to a Feet param must reject the same way a
// `meters!` value handed to a `feet!` param does.
//
// A produced Meters value bound and passed onward as Feet must be
// rejected by the Koru checker — before any Zig compilation.
~import std/types
const std = @import("std");
~std/types:struct(Meters) {
v: i64,
}
~std/types:struct(Feet) {
v: i64,
}
~tor measure {} -> Meters
~proc measure|zig {
return Meters{ .v = 8848 };
}
~tor report-feet { f: Feet }
~proc report-feet|zig {
std.debug.print("{d}ft\n", .{f.v});
}
~measure(): h |> report-feet(f: h)
Backend must reject with:
CONTAINS error[KORU
CONTAINS Meters
CONTAINS FeetFlows
flow ~struct click a branch to expand · @labels scroll to their anchor
struct (expr: Meters, source: v: i64,)
flow ~struct click a branch to expand · @labels scroll to their anchor
struct (expr: Feet, source: v: i64,)
flow ~measure click a branch to expand · @labels scroll to their anchor
measure