10000 Incorrect/unreasonable suppression behavior of `s.u.Using` · Issue #13088 · scala/bug · GitHub
[go: up one dir, main page]

Skip to content

Incorrect/unreasonable suppression behavior of s.u.Using #13088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NthPortal opened this issue Feb 18, 2025 · 0 comments · Fixed by scala/scala#11000
Closed

Incorrect/unreasonable suppression behavior of s.u.Using #13088

NthPortal opened this issue Feb 18, 2025 · 0 comments · Fixed by scala/scala#11000
Labels
Milestone

Comments

@NthPortal
Copy link

I was looking over the docs for Using recently, and noticed that ControlThrowable suppresses NonFatal exceptions. But I don't think that should be the case. ControlThrowable is control-flow, and ought to lose to "something went wrong".

Currently, exceptions are ranked using this method in which all NonFatal exceptions are ranked lower than fatal exceptions, and the various fatal exceptions are ranked relative to each other. ControlThrowable is already suppressed in favour of any other fatal exception; I simply propose it be suppressed in favour of all other exceptions.

While this does change behaviour potentially underneath users' feet, I think it is still a worthwhile change because:

  • ControlThrowable (usually non-local return) isn't that common
  • the current behaviour essentially silently drops exceptions
  • I don't know if anyone has ever encountered this situation anyway
@SethTisue SethTisue changed the title Incorrect/unreasonable suppresion behavior of s.u.Using Incorrect/unreasonable suppression behavior of s.u.Using Feb 20, 2025
@SethTisue SethTisue added this to the 2.13.17 milestone Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0