Since Scala 2.13, -Wconf compiler flag allows to precisely control over which warnings should be handled as errors. The configuration string for -Wconf however is not always the same when migrating to Scala 3.
In particular, I'm struggling to find how to make the compilation fail on non-exhaustive pattern matches in Scala 3. In Scala 2.13 I was used to rely on
-Wconf:cat=other-match-analysis:error
but the same string is not recognised in Scala 3:
Failed to parse `-Wconf` configuration: cat=other-match-analysis:error
The documentation https://docs.scala-lang.org/scala3/guides/migration/options-lookup.html does not seem to cover this case, unless I've missed it.
It's always possible to turn all warnings into errors, but it would be great to have the same degree of granularity that Scala 2.13 offers.
Would anyone be able to point me to how to configure Scala 3 compiler to fail the compilation when a pattern match is non-exhaustive, without turning all other warnings into errors?
Similar question for Scala 2.13 Make Compile Fail on Non-Exhaustive Match in SBT
I think Scala 3 is well behind in regards to detecting warnings and categorize them in comparison with Scala 2.13. I could not find the exact documentation for
-Wconffor scala 3 to reference it here but the following might be useful.Here's how scala 2.13 shows what it supports in
-WconfformatIt produces help message with following part related to categories of error/warning as
Same command doesn't work in scala 3.3 and the closest I can get to some sorts of documentation is following
An interesting part of warnings configuration is following