I'm not sure I like the idea that zig really compiles only code being called... seems sort of a forcing towards "test-first" or TDD that I personally find a quite questionable practice as it slows down A LOT unless you've a crystal clear idea beforehand of what needs to be implemented and with what interface (rarely the case in my experience, unless you are just re-writing something already existing for weird reasons).
I must say feels like sort of aligned with the weird approach of having unused locals or non-mutated variables being errors (!?... those are not YET used locals and not YET mutated variables). So in a sense it's coherent... in a mistake, but coherent.
Anyway it's the way it is... zig doesn't check partial code. For now I'll just keep calling zig ast-check with the current file in memory... better than nothing.