✓
Passing Passing: the compiler rejects this program as expected.
Code
~import app/holder
~import std/io
// A qualified host ref must name the module that declares the type. `Token`
// belongs to `app/holder`; `app/wrong` declares nothing, so the ref must be
// refused here rather than leaking to codegen as a raw Zig "no member named".
~tor describe { t: *app/wrong: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[KORU117]: host type 'Token' is declared by app/holder, not 'app/wrong'
--> tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_038_qualified_host_type_wrong_module/input.kz:6:0
|
6 | // refused here rather than leaking to codegen as a raw Zig "no member named".
| ^
hint: write the declaring module: *<module>:TokenMust fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
host type 'Token' is declared by app/holder, not 'app/wrong'Flows
flow ~mint click a branch to expand · @labels scroll to their anchor
mint (id: 7)
Test Configuration
MUST_ERROR