But seriously, the reasons I see are: - Beyond a local frame, types don't really help "make invalid states unrepresentable" because the way large systems fail is open-ended - Types encourage different representations of the same error, because you end up wrapping them
-
-
But that could easily be called a deficiency in the language and fixed with some new syntax for sure
-
Yeah, we allow pattern-matching an enum through the Error type in Swift. I feel like there could be a still better language feature for matching interesting errors, though…
End of conversation
New conversation -
-
-
I've always thought the error trait is more for constructing error reports, the downcasting stuff is really the Any trait's responsibility but that couldn't be added as a super trait because Any has a 'static bound Matching against Any or Error does sound nice tho...
-
There's gotta be a macro library for that...
- 9 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.