Hacker News new | ask | show | jobs
by jamii 498 days ago
If I have multiple errors then that in-out parameter has to be a union(enum). And then I'm back to creating dozens of slightly different unions for functions which return slightly different sets of errors. Which is the same problem I have in rust. All of the nice inference that zig does doesn't apply to my in-out parameter either. And the compiler won't check that every path that returns error.Foo always initializes error_info.Foo.
1 comments

i dont think you can make a union that has an error enum tag. I dont see why the in-out has to be dependent on the error.