@typeInfo
should return declarations in declaration order
#4495
Labels
Milestone
@typeInfo
should return declarations in declaration order
#4495
Currently
@typeInfo
returns declarations in hash map order, which leaks nondeterminism into builds. It also prevents declarations from being used as data. E.g. here:zig/lib/std/target/riscv.zig
Lines 71 to 120 in 5e37fc0
Currently
std.meta.declList
does a comptime sort. But that should be unnecessary, and in some cases declaration order could be meaningful.A related proposal is to remove declarations from
@typeInfo
altogether. I thought I had an open proposal for that, but I can't find it at the moment.Another related pull request right now is making
@typeInfo
declarations lazy: #4435The text was updated successfully, but these errors were encountered: