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)
6 lines
212 B
Plaintext
6 lines
212 B
Plaintext
// #23 — two top-level defs of the same name in one (flat) module.
|
|
// cstage's install pass rejects "duplicate def D"; wwstage now mirrors.
|
|
def D: i32 = 1;
|
|
def D: i32 = 2;
|
|
export fn main() i32 = { return 0; };
|