Following up on a conversation in scala/bug#12441, is there a selected mechanism for getting -Xlint-style warnings?
If this is being moved out of the compiler into a plugin, possibly backed by something like semanticdb, that makes sense to me, I just haven’t found any documentation about it (the compiler options lookup table just lists X for those, for instance).
Thanks for your work on dotty/scala3, looking forward to moving my projects to it.
There isn’t one so far, and no one has stepped up to port the Scala 2 linting warnings to Scala 3 yet. I think the first step here would be to figure out which -Xlint warnings are the most popular. Then, for each of these warnings we should ask ourselves:
Why isn’t it enabled by default? If it’s because the false positive rate is too high or the performance impact is too important, can we solve that?
Is this lint only needed because of a defect in the language? If so can we fix the language instead of adding a warning?
Well, having multiple different flags with the same meaning isn’t great, so I’d say if we add it back it should itself be deprecated and point to -deprecation. (Also since lints are warnings -W would be more appropriate than -X, but that’s maybe too much bikeshedding.)
I’m really desperate for the “value discarding” lint to return. It’s borderline essential for productively writing apps with cats-effect/zio, because value discarding can cause the app to compile in a way that just doesn’t execute branches of code.
I’ve written exactly one toy project in scala3, in a single file, and lost multiple hours to such a bug already. Newcomers to the language really need this to be productive
It’s not perfect yet. (It took a while to get the Scala 2 implementation up to its current quality level, too.) You can help by reporting issues under this label: