-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Introduce warning supression for problematic pattern-matches #91
base: main
Are you sure you want to change the base?
Introduce warning supression for problematic pattern-matches #91
Conversation
I didn't specify the warning suppression directly at the affected place as this would kill readability of the code. (I've tried!) Also this allows to have small batches of issues to upstream. So the process of getting rid of the annotations again wouldn't take too long. (OK, it will take very long, as issues with the exhaustiveness checker are notorious in Scala. But one needs to start somewhere…) |
The other thing is: The "Unchecked Warnings" look actually more dangerous as the pattern matching issues. The pattern match checker is often very wrong in Scala. But the "Unchecked Warnings" point more than often to real issues. Should this get separately investigated? Does it need a dedicated ticket? |
This is a temporary workaround. The long term goal is to get rid of these nasty annotations again. This will need support form the Scala team though.
99f6d8c
to
b9f45eb
Compare
I think we are on the same page with the ultimate goal being We can't have both today, due to issues in the Scala compiler. (Aside: Although it's IMO unlikely that things with the compiler will improve in the near future, reporting the issues is still about the best thing we can do to help.) I do agree with you that eliminating noisy warnings from the build is valuable, so that in the development process we can focus on the parts of the code that were changed. A counterpoint being that exhaustiveness of a pattern match may break at a distance (without changes in the pattern match itself). But still, I think you would argue, we have a chance to catch at least some errors, as opposed to capitulate completely to the flood of false warnings. This is all well and good. But I also want to see a path from here to the ultimate goal. Things might actually improve in scalac over the coming years. When something improves in the compiler, how do we find out
I'd like to set some kind of a reminder. (If each suppression was annotated with a link to a scalac ticket, we'd know 1. by subscribing to notifications on that ticket, and 2. by What's the proposed way to go forward from suppressed warnings?
Do you mean that each |
Exactly! I actually hate It's a measure of last resort. But: Being warning free is the only sane thing in any code base that doesn't fit on a page.
In a sense, yes. But let's try your approach first and see how far we can get: Let's try create upstream tickets for all the current
Yes, this makes sense. Being involved directly will give the needed visibility. I'm going to help here! Only, likely not before the weekend. Thanks again for pushing this forward! 👍 |
This is a temporary workaround! The long-term goal, of course, is to get rid of these nasty annotations again. But this will need support from the Scala team though as there seem to be issues with the current pattern matcher exhaustiveness checker.
The idea is to pick one of the annotated places, temporarily remove the warning suppression, based on the error create an upstream issue in Scala, wait for resolution or even help resolve it, and than kill the picked
@nowarn
annotation for good. Rinse and repeat until all annotations are gone…It makes no sense, imho, to keep an ever growing pile of warnings in Libretto. Also, breaking the problem in small actionable issues will help to solve it. The current state is a little bit overwhelming to tackle all at once.