✓
Passing Passing: the compiler rejects this program as expected.
Code
// PIN: spelling the door is refused — `lib/door:default(...)` never reaches
// the door. The `:default` segment is compiler-manufactured: the import
// pipeline rewrites the bare `lib/door(...)` call to it, so writing it is
// redundant surface. KORU208 teaches the bare spelling, at the flow root and
// in continuation position alike.
import lib/door
import lib/wrapped
import std/io
lib/door:default(name: "root"): v1
|> lib/door:default(name: "nested"): v2
|> std/io:print.ln("{{ v1:s }} then {{ v2:s }}")
Supporting Files
// A module whose `default` tor is the door a bare `lib/door(...)` call opens.
~pub tor default { name: string } -> string
~proc default|zig {
return name;
}
// A module whose own body spells the door — the imported-module pass refuses
// it with the same diagnostic as the entry-file spelling.
import lib/door
lib/door:default(name: "wrapped")
Actual compiler output
error[KORU208]: 'lib/door:default(...)' spells the default door explicitly — invoke the module path itself: 'lib/door(...)'
error[KORU208]: 'lib/door:default(...)' spells the default door explicitly — invoke the module path itself: 'lib/door(...)'
error[KORU208]: 'lib/door:default(...)' spells the default door explicitly — invoke the module path itself: 'lib/door(...)'
error: ExplicitDefaultDoorCall
/Users/larsde/src/koru/src/import_pipeline.zig:1342:38: 0x102af3123 in combineImports (koruc)
if (spelled_door_violations > 0) return error.ExplicitDefaultDoorCall;
^
/Users/larsde/src/koru/src/main.zig:8357:28: 0x102d0347b in main (koruc)
const combine_result = try import_pipeline.combineImports(
^Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
'lib/door:default(...)' spells the default door explicitly — invoke the module path itself: 'lib/door(...)'Flows
flow ~default click a branch to expand · @labels scroll to their anchor
default (name: "root")
Test Configuration
MUST_ERROR
koru.json:
{
"paths": {
"std": "../../../../../koru_std",
"lib": "./test_lib"
}
}