-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Safer exceptions with many cases in catch #13816
Comments
The first error we can fix but not the second. We do not allow aggregation of |
I might be misunderstanding something but looking at the discussions around the original PR #11721 I still don't understand why If we had a simple contravariant type class like
Then an instance of
desugars to
but if it instead gets desugared to
then everything should work. |
@prolativ: You are right. I was confused because |
Compiler version
3.1.1-RC1-bin-20211020-afaac17-NIGHTLY
Minimized code
Output
Expectation
The compiler should be able to figure out that all the declared exceptions are handled. Interestingly adding
case _: (Ex1 | Ex2) =>
inside catch makes the compiler stop complainingThe text was updated successfully, but these errors were encountered: