Open arnetheduck opened 7 months ago
That is in conflict with my long term goals of only tracking "any" exception thrown vs "no" exception thrown as opposed to this fine grained sophistry which Nim inherited from other languages and didn't come from first principles.
That is in conflict with my long term goals of only tracking "any" exception
That's not the language we have to work with today though, where this hint becomes a necessary feature to get rid of excessive exception handling (which turns out to be costly for larger projects).
As to the introduction of "any" vs "no" exception, I imagine that can be done with a separate tracker and a separate keyword at which point both will coexist (experimentally) with some overlap time (meaning that the hint is useful today and for the foreseeable future until that happens).
It would also require addressing the fundamental problem with except:
, namely that it sometimes catches Defect and sometimes not (it would be workable if it never caught defect, the catching of which would require an explicit except Defect
).
Summary
Introduce a hint when exception handler catches a broader exception type than is raised
Description
Similar to #23366 but distinct in semantics, an exception handler that catches more exceptions than necessary may introduce unexpected runtime behavior when dependent code changes:
Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response