News for hackers. Stuff that matters.
Re:Never patterns, exhaustive matching, and uninhabited type... by phyzome on Saturday August 18, 2018 @08:20PM (#17791697)
An example I can think of is Java's StringReader class. It implements the Reader interface, so it has to bear the "throws IOException" signature... but it's impossible for it to produce an I/O error, since it's not actually doing any I/O, just reading from a String.

That's fine if you're using it via the Reader interface, but if you're working with StringReader directly it's a pain in the butt to deal with the non-existent exceptions. It sounds like never-patterns would help with that.

There are no comments on this comment yet.