✓
Passing This code compiles and runs correctly.
Code
// RED PIN, MUST_ERROR (type-system design walk, 2026-07-06/07).
// REWRITTEN — the old "wrong arity in Pair<A>" intent belonged to the
// banned parametric grammar. The surviving intent is the deeper one:
// NOMINAL DISTINCTNESS. Two structurally identical declared types are
// DIFFERENT types; cross-use is rejected at the Koru layer citing both
// declarations.
//
// The value-level half of this ALREADY RUNS and is not the registry's
// doing: the phantom checker refuses same-shaped, distinct-identity
// VALUES — `i64<feet!>` vs `i64<meters!>` cross-use is a koru-led
// phantom-state mismatch (frag-bare-phantom-resolves-to-base-type-
// module; the taint corpus). This pin is that same argument moved up
// one level: from value STATES to DECLARED-TYPE IDENTITY. `Feet` and
// `Meters` are two registry ENTRIES and one shape; the registry extends
// the checker's existing same-shape-distinct-identity reasoning from
// primitives-with-states to declared types — it does not invent
// distinctness, it gives declared types what phantoms already give
// primitives. Today's scaffolding emits plain Zig aliases, so this
// leaks through silently — which is exactly the old cluster TODO's
// named gap ("without nominal distinctness"), now pinned as a
// rejection.
~import std/types
const std = @import("std");
~std/types:struct(Meters) {
v: i64,
}
~std/types:struct(Feet) {
v: i64,
}
~tor get-altitude {} -> Feet
~proc get-altitude|zig {
return Feet{ .v = 30000 };
}
~tor show-meters { m: Meters }
~proc show-meters|zig {
std.debug.print("{d}m\n", .{m.v});
}
// ERROR: Feet where Meters is expected — same shape, distinct types
~get-altitude(): a |> show-meters(m: a)
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 ~get-altitude click a branch to expand · @labels scroll to their anchor
get-altitude