authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-03-13 19:16:09+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-03-14 07:40:08+00:00
log7c3237019454a6009d96eca31f36a1d9e6ce02aa
tree2b67d56ff2e9ec9c44153c48f201ac506d674b20
parent347196f905c083047fdc0a3b72656f1867973a13
signaturelock-open Commit is signed but in an unrecognized format.

Zcu: preserve ordering of `usingnamespace` decls

See comment. This slightly regresses a previous fix from this branch. A proper solution will come soon, with the splitting up of `Decl` into `Cau` and `Nav`.

1 files changed, 4 insertions(+), 1 deletions(-)

src/Module.zig+4-1
......@@ -4358,7 +4358,10 @@ fn scanDecl(iter: *ScanDeclIter, decl_inst: Zir.Inst.Index) Allocator.Error!void
43584358 };
43594359 },
43604360 .@"usingnamespace" => info: {
4361 if (iter.pass != .unnamed) return;
4361 // TODO: this isn't right! These should be considered unnamed. Name conflicts can happen here.
4362 // The problem is, we need to preserve the decl ordering for `@typeInfo`.
4363 // I'm not bothering to fix this now, since some upcoming changes will change this code significantly anyway.
4364 if (iter.pass != .named) return;
43624365 const i = iter.usingnamespace_index;
43634366 iter.usingnamespace_index += 1;
43644367 break :info .{