✓
Passing Passing: the compiler rejects this program as expected.
Code
// Pins the refusal: when koru.json and a `bindings` block both name `koru/vaxis`
// and point at DIFFERENT trees, the compilation stops.
//
// This is the fault the binding-feeds-the-import work exists to remove. Silently
// preferring either declaration would leave the program importing one tree while
// the pin guards another — a checked dependency that is not the dependency being
// used, which is worse than no pin at all because it reads as protection.
import std/io
import std/vendor
std/vendor:bindings {
koru/vaxis: ./vendored/vaxis
}
import koru/vaxis
koru/vaxis:greet(): v |> std/io:print.ln("{{ v:s }}")
Supporting Files
~pub tor greet {} -> string
~proc greet|zig {
return "THE WRONG TREE";
}
// The vendored copy. Reachable only because the `bindings` block said where it
// lives — this directory is named in exactly one place.
~pub tor greet {} -> string
~proc greet|zig {
return "VENDORED vaxis";
}
Actual compiler output
error[KORU171]: std/vendor:bindings pins `koru/vaxis` at `./vendored/vaxis`, but it already resolves to `./elsewhere` - one of the two is importing a tree it is not checking
--> tests/regression/100_MODULE_SYSTEM/130_PACKAGES/130_007_vendor_binding_conflicts_with_path/input.k:12:1
|
12 | std/vendor:bindings {
| ^Must fail at frontend compile:
Parsing or type-checking must reject the program.
Error output must contain
one of the two is importing a tree it is not checkingTest Configuration
MUST_ERROR
koru.json:
{
"paths": {
"koru/vaxis": "./elsewhere"
}
}