Skip to content
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

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

Open
NthPortal opened this issue Feb 18, 2025 · 0 comments · May be fixed by scala/scala#11000
Open

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

NthPortal opened this issue Feb 18, 2025 · 0 comments · May be fixed by scala/scala#11000
Labels

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
@NthPortal NthPortal linked a pull request Feb 18, 2025 that will close this issue
@SethTisue SethTisue changed the title Incorrect/unreasonable suppresion behavior of s.u.Using Incorrect/unreasonable suppression behavior of s.u.Using Feb 20, 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