Open
Description
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:
proc f() {.raises: [ValueError].} =
raise (ref ValueError)()
try:
f()
except CatchableError: # Only ValueError is raised here which is more specific
discard
Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response