✓
Passing Passing: the compiler rejects this program as expected.
Code
// TEST: bare cross-module host type in a tor signature is REFUSED.
//
// `holder` owns the `Token` host (Zig) type. This module only imports it, so
// naming the type BARE in a signature — `*Token` — must be refused at compile
// time, and the refusal must name the fix: qualify it, `*app/holder:Token`.
// A host type is bare inside the module that declares it; across a module
// boundary it spells fully qualified, same as invocations.
//
// Ruled 2026-09-06: bare cross-module host-type references are RETIRED. They
// were resolved program-wide, first declaration wins (the HostTypeHomes
// registry), and the aspiration died on three counts:
// - import-order shadowing — a consumer's import order rewrote a third
// module's OWN signatures (`import std/interpreter` before
// `import koru/yyjson` flipped yyjson's own `*Value` to interpreter's;
// repro: koru-libs repro-yyjson headless/repro.k, which never mentions
// `Value` at all);
// - two providers — modules declaring the same host name collided, with no
// spelling that says which one a signature means;
// - bystander modules — a program that never names the type still rewrote
// the declaring module's emitted Zig.
// Qualifying at the boundary names the provider at every use; bare stays
// legal exactly where the declaration lives.
//
// Found 2026-09-06: `orisha:answer` could not take `*Exchange` (a pump host
// type) from the index module because the bare name never reached the
// declaring module in emitted Zig.
~import app/holder
~import std/io
~tor describe { t: *Token } -> string
~proc describe|zig {
_ = t;
return "token";
}
~app/holder:mint(id: 7): t |> describe(t): d |> std/io:print.ln(d)
Supporting Files
const std = @import("std");
pub const Token = struct { id: u32 };
~pub tor mint { id: u32 } -> *Token
~proc mint|zig {
const t = std.heap.page_allocator.create(Token) catch unreachable;
t.* = Token{ .id = id };
return t;
}
Actual compiler output
error[KORU115]: host type 'Token' crosses a module boundary bare — write it qualified: *app/holder:Token
--> tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_031_bare_cross_module_host_type/input.kz:30:0
|
30 |
| ^
hint: the bare spelling is legal only inside the module that declares it ('app/holder', same rule as invocations)Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
*app/holder:TokenFlows
flow ~mint click a branch to expand · @labels scroll to their anchor
mint (id: 7)
Test Configuration
MUST_ERROR