I've noticed there are some functions, like fs.Dir.close, which do not return an error, but are capable of hitting unreachable code. The comments above the posix.close function state that they are incapable of returning an error (is this a technical limitation?)
What is the user expected to do here? Does unreachable always indicate a mistake from the calling code side? In my case I am purposely calling close on a dir while iterating it in order to better understand error handling in Zig. My expectation was that I'd get back an error which my catch statement would handle.
Am I misunderstanding the contract between the API and failure conditions?
Thanks