You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see tests that call 'refAllDecls' in almost every library. What's the purpose of those? If it is so necessary to have and maintain those, why it's not embedded into compiler?
The text was updated successfully, but these errors were encountered:
Zig uses "lazy loading" of code which means that if the code is not used, it is not compiled. This helps with compilation speed and the size of binaries because the code that is not used is not in the final binary.
In tests however we often want to check that at least the syntax and types are correct, and a bunch of other things in addition to that. refAllDecls references all declarations in a module effectively saying Zig to "use" them, so they are loaded and checked. I don't know whether they exist in the final binary with that, but for the test you probably don't mind it anyway. If you don't do refAllDecls, you may have code that is in fact incorrect and Zig compiler will yell at you once you try to use it, even though previously there was no problem when you worked with other code.
I see tests that call 'refAllDecls' in almost every library. What's the purpose of those? If it is so necessary to have and maintain those, why it's not embedded into compiler?
The text was updated successfully, but these errors were encountered: