Background: Zig type-checks a pub declaration only when something references it, so a dead or bench-only pub fn can ship with a type error that zig build test never catches (this bit us in #58). #70 first closed the gap with a refAllDeclsRecursive helper in tests/reflect.zig, but that reimplements exactly the recursive variant std removed in 0.16 (unbounded traversal across pub re-exports, eval-quota pressure). We reverted the helper and kept only the dead-code removal, so the gap is open again — by choice, since a per-module reflection hack is the wrong home for it.
This is a static-analysis / lint concern, not something to hand-roll in test code.
Ask: evaluate what exists as of now and pick one, or decide to live with the gap:
- a standalone Zig linter, if a maintained one exists
- ZLS diagnostics run in CI (headless), if it can flag this
- an upstream compiler flag / "analyze all decls" mode (check current ziglang/zig direction)
Deliverable: a short recommendation with the trade-offs, not an implementation.
Background: Zig type-checks a
pubdeclaration only when something references it, so a dead or bench-onlypub fncan ship with a type error thatzig build testnever catches (this bit us in #58). #70 first closed the gap with arefAllDeclsRecursivehelper intests/reflect.zig, but that reimplements exactly the recursive variant std removed in 0.16 (unbounded traversal across pub re-exports, eval-quota pressure). We reverted the helper and kept only the dead-code removal, so the gap is open again — by choice, since a per-module reflection hack is the wrong home for it.This is a static-analysis / lint concern, not something to hand-roll in test code.
Ask: evaluate what exists as of now and pick one, or decide to live with the gap:
Deliverable: a short recommendation with the trade-offs, not an implementation.