✓
Passing Passing: the compiler rejects this program as expected.
Code
~import app/holder
~import std/io
// A qualified host ref must resolve. `Tokn` is a typo for holder's `Token`;
// without KORU117 this reaches codegen as a raw Zig "has no member named" on
// the emitted artifact name (output_emitted.koru_app.koru_holder.Tokn).
~tor describe { t: *app/holder:Tokn } -> 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]: unknown host type 'Tokn' — no module declares it
--> tests/regression/200_COMPILER_FEATURES/220_COMPILATION/220_037_qualified_host_type_must_resolve/input.kz:6:0
|
6 | // the emitted artifact name (output_emitted.koru_app.koru_holder.Tokn).
| ^
hint: check the spelling; a qualified host reference must name a type its module declaresMust fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
unknown host type 'Tokn'Flows
flow ~mint click a branch to expand · @labels scroll to their anchor
mint (id: 7)
Test Configuration
MUST_ERROR