✓
Passing Passing: the compiler rejects this program as expected.
Code
// The Koru-layer deref check (rung 2): `f.bogus` names no registered field,
// so the projection is refused here, in Koru's voice, naming the field and
// the entry — it never reaches the backend. The CONTAINS below discriminates
// that layer (Zig's undeclared-identifier error never names `bogus`).
// Present fields wave through to host linkage (667_005).
import std/io
import std/foreign
std/foreign:struct(File) {
path
handle
}
pub tor get-bogus { f: *File } -> string
get-bogus -> f.bogus
Actual compiler output
error[KORU030]: foreign entry 'File' has no field 'bogus' (fields: path, handle) — a foreign deref names a registered presence claim; the host owns substance
--> tests/regression/600_STDLIB/667_FOREIGN/667_004_foreign_deref_checked_in_koru/input.k:17:0
❌ Compiler coordination error: Validation failed (see errors above)
(set KORU_BACKEND_TRACE=1 for the backend return trace)Compiler must reject:
Compilation must fail with a diagnostic.
Flows
flow ~struct click a branch to expand · @labels scroll to their anchor
struct (expr: File, source: path
handle)
Test Configuration
MUST_ERROR