Hacker News new | ask | show | jobs
by 90s_dev 352 days ago
Unused variables stops all further compilation, so that even future errors can't be seen until the variable is used.
2 comments

This is simply not true. See https://zigbin.io/f57b94/run.

(That link seems to show the "unused local variable" error line twice for me; that's some kind of bug with this zigbin service and does not reproduce when running the Zig compiler normally.)

Meh.

I think this should be a warning on debug builds and an error on release builds, but it's a relatively minor thing and not a deal breaker by any means.

If this is the worst thing that people would like to see revisited, Zig must be doing amazingly well.

> but it's a relatively minor thing and not a deal breaker by any means.

It totally breaks my normal workflow. I don’t use zig at all because of this misfeature. Warn in debug and error on release builds would be strange but fine.