logoalt Hacker News

dpassens08/10/20251 replyview on HN

No, you misunderstand. The function doesn't return any type, it returns _a_ type. Types are values in Zig and returning them from function is how generics are implemented.


Replies

brabellast Monday at 6:55 AM

I know how Zig works. `type` is some type the function will return, you must look at the implementation to know what actually got returned, given the comptime arguments given to it by the caller (as I already mentioned). Where is the misunderstanding??

show 1 reply