-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Missing unreachable case warnings #4661
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
@smarter Current implementation only check for the last case because the computation is a little expensive (much more than unreachable case analysis). We can still do the analysis for all cases, and see how it impacts performance. |
I think there are several things going on here:
The code above is what runs in a loop for the reachability checks. Looking at how we explicitly add a However, within
This means that when we intersect One solution, it seems to me, is to handle the Incidentally, that also fixes #4660 as well. @liufengyun does that make sense? What do you guys think? |
Thanks a lot for the in-depth diagnosis @abeln , I think that is the right fix. Could you please make a PR? |
Fix #4661: Missing unreachable case warnings
The test case comes from scala#4660, which is a related bug.
The test case comes from scala#4660, which is a related bug.
Add additional test case for #4661
Given:
We should get three warnings since the three last cases are not reachable, but we only get one for the last case:
(The warning itself is a bit confusing but that's a separate issue: #4660)
The text was updated successfully, but these errors were encountered: