3 ms·
> Attempting to get the complete set of error types that any given call may raise is a fool's errand because of the halting problem it eventually invokes. That
by heavenlyblue 6y ago
> Attempting to get the complete set of error types that any given call may raise is a fool's errand because of the halting problem it eventually invokes.
That’s not true.
- im3w1l 6y agoYeah, it only becomes an issue if you want the compiler to infer that ImpossibleError cannot be raised in while True: pass raise ImpossibleError But normally we are perfectly content to put ImpossibleError in the signature for code like this.
- heavenlyblue 6y agoActually in this specific case you can infer that, and you can have an exhaustive list of language constructs beyond which this becomes undecidable. There is a practical example of “panic!” in Rust to go around that as well.