✓
Passing This code compiles and runs correctly.
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 }}")
Must fail at frontend compile:
Parsing or type-checking must reject the program.
Imported 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";
}
Test Configuration
Expected Error:
one of the two is importing a tree it is not checking