-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Should inline matches strip type ascription? #11291
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
Comments
@odersky @OlivierBlanvillain WDYT? |
I think at one point we discussed that inline matches should try to re-type their scrutinees as accurately as possible before matching. Stripping type ascriptions seems to be a part of that. |
We do retype the scrutinee. But as the ascription is not removed/ignored the type will not get more precise. |
Not sure. Is there a reason why one would need to add |
A type ascription could prevent a |
Compiler version
3.0.0.M3
Minimized example
Output
Expectation
Should this code compile? It looks like it should. Not sure if there are use-cases where we would want to avoid this.
The text was updated successfully, but these errors were encountered: