-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Lost type member bounds for refined pattern types #13820
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
I'm not sure this is a bug. Same behavior in Scala 2. |
It's is/was a bug in Scala 2 too! There's no reason |
We should not allow this to compile unless we also ensure that it emits an unchecked warning. |
Unassigning myself since if there's anything in the compiler I will be taking a look at anytime soon, it will be issues directly related to GADTs. |
Only map type bounds to pattern-bound symbols at the toplevel of a pattern, or when they appear as type arguments. Do not map them in refinements. Fixes scala#13820
Only map type bounds to pattern-bound symbols at the toplevel of a pattern, or when they appear as type arguments. Do not map them in refinements. Fixes scala#13820
Compiler version
3.1.0
Minimized code
Output
Expectation
The code should be accepted, since
e1.T
is defined to be the subtype ofInt
. However, by inspecting the typer, we found that the pattern will be typed as_: Expr{type T = _}
where_
is the wildcard type, and the information about the bounds<: Int
gets lost.The text was updated successfully, but these errors were encountered: