✓
Passing This code compiles and runs correctly.
Code
// RED PIN, MUST_ERROR (type-system design walk, 2026-07-06/07).
// REWRITTEN from the dead `Option<i32>`/`Option<f32>` generation.
// Distinct stamped identities are distinct types: box#f64 flowing into
// an event expecting box#i64 must be rejected — at the KORU layer, by
// the registry-backed checker, with a diagnostic naming both types
// (not a Zig error pointing into generated code; today binding/payload
// types are strings the checker cannot reason about — the 2026-07-06
// walk's "checked earlier" requirement).
//
// The value-level shape of this argument already runs: the phantom
// checker refuses same-shaped distinct-identity VALUES (`feet!` vs
// `meters!`). `box#i64` vs `box#f64` is that same refusal moved up to
// STAMPED TYPE identity — the registry's job, mirroring a power the
// checker already has rather than inventing one. Spelling PROVISIONAL.
//
// SPELLING NOTE (2026-08-13): the original single-branch form
// (`| made box#f64`) is refused at parse by PARSE003 (a lone payload
// branch is a one-variant tag union — the parser demands the bare
// return `-> box#f64`). The program uses the bare-return spelling the
// parser insists on; the intent (stamped identity mismatch) is
// unchanged.
~import std/types
const std = @import("std");
~std/types:struct(box#i64) {
value: i64,
}
~std/types:struct(box#f64) {
value: f64,
}
~tor make-float-box {} -> box#f64
~proc make-float-box|zig {
return @"box#f64"{ .value = 3.14 };
}
~tor show-int-box { b: box#i64 }
~proc show-int-box|zig {
std.debug.print("Value: {d}\n", .{b.value});
}
// ERROR: box#f64 where box#i64 is expected
~make-float-box(): m |> show-int-box(b: m)
Backend must reject with:
CONTAINS error[KORU
CONTAINS box#i64
CONTAINS box#f64Flows
flow ~struct click a branch to expand · @labels scroll to their anchor
struct (expr: box#i64, source: value: i64,)
flow ~struct click a branch to expand · @labels scroll to their anchor
struct (expr: box#f64, source: value: f64,)
flow ~make-float-box click a branch to expand · @labels scroll to their anchor
make-float-box