Get the latest tech news
In Zig, what's a writer?
Karl Seguin's Blog - A mix of coding and creative writing
Even though our write function returns an explicit error, that type information is lost when we convert our DummyWriterAny to a AnyWriter. I say "usually", because there's no guarantee; it relies on all of us agreeing that a variable named writer of type anytype only ever uses methods available to a GenericWriter. If I understand correctly, the motivation for this design, was reducing code bloat while providing a mechanism to preserve typed errors.
Or read this on Hacker News