3 ms·
Yeah, it only becomes an issue if you want the compiler to infer that ImpossibleError cannot be raised in while True: pass raise ImpossibleError But n
by im3w1l 6y ago
Yeah, 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.