3 ms·
...which is even worse, because now the compiler is saying "when you call this, you will get this" and you have NO way of knowing that the call actually returns
by bedobi 2y ago
...which is even worse, because now the compiler is saying "when you call this, you will get this" and you have NO way of knowing that the call actually returns any number of exceptions, as a matter of course, without reading EVERY line called by EVERY line in that method
vs just plainly indicating you will get Either<Error, Foo>
- wiseowise 2y agoWhat are you talking about? You literally can with sealed classes.
- bedobi 2y agoI'm talking about the fact that every function call in Kotlin can return an exception (and it will always be undeclared, because Kotlin doesn't have checked exceptions) this has nothing to do with sealed classes