-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Match type reduction failure #19326
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 believe it's more of the same as what I mentioned at #19309 (comment) Inside |
@sjrd How could that code be fixed? I wonder whether it wouldn't make more sense for Finally, regardless of whether the compilation failure is intended, the error message still seems problematic, since |
At least in this case you could replace the usage of
Unfortunately, that is not possible.
I agree that the error message is not great here. I am not sure how to detect this situation, however. Perhaps there is a way to add the information that an opaque type alias was involved somewhere in the match type reduction trace, in order to hint that there's probably an issue with the interaction between match types and opaque type aliases within their declaring scope. |
@sjrd thank you for your detailed reply. You are of course free to close the issue if you think improving the error message is not feasible. Concerning the fix you suggested for the minimized code, I don't think it is applicable to my project. I started a thread on Scala users to continue this discussion. |
Compiler version
3.4.0-RC1, 3.4.0-RC1-bin-20231221-beaf7b4-NIGHTLY
Minimized code
Compiler output
Expectation
The code is expected to compile, as in Scala 3.3.1 and 3.3.2-RC1.
(See also here)
The text was updated successfully, but these errors were encountered: