installdecl routes all four kinds (fn/type/def/let) through installtop, which turns scopedefineinmodule's nil return into cstage's exact "duplicate <kind> <name>" reject, keyed (name,mod) so cross-package same-leaf decls coexist. Builtin redecls are dropped, not dup-errored: cstage never scopes builtins (lookup_builtin first, check.c:69), so a user redecl is dead there — wwstage mirrors via scopesamekeysym + no-source-decl test. -T synth __wwtests installs direct, mirroring check.c:3079. Closes the silent dup-fn hole (user fn run vs lib/test run built a broken test binary with no diagnostic). Per-kind reject rows + cross-package/builtin accept byte-id rows + -T collision parity row in 910/997. (#23-team, category-A addendum closed)
10 lines
361 B
Plaintext
10 lines
361 B
Plaintext
// #23 -T collision — a user `fn run` collides with lib/test's bound
|
|
// runner `run` (the synth's callee) once `ww test -c` bundles lib/test.
|
|
// Both stages must loud-reject "duplicate fn run" (rc!=0), never silently
|
|
// build a binary that calls the wrong run and skips every @test.
|
|
fn run() void = { return; };
|
|
|
|
@test fn t_one() void = {
|
|
assert(1 == 1);
|
|
};
|