


Simplified Manifest synthesisįor the sake of compatibility with Scala 2, the Scala 3 compiler now generates given instances for the Manifest trait. For the more details see the output of -Wconf:help flag. Wconf and work largely the same way as in Scala 2, but some filters for selecting warnings are different. It can be used for suppressing warnings directly in the code, in the places where they are expected to occur. We have also brought back annotation from Scala 2.13, originally inspired by the silencer plugin. Support for -Wconf and have added a -Wconf compiler flag that allows filtering and configuring compiler warnings (silence them, or turn them into errors). This behavior is consistent with what Java does and more performant than the old approach. Will now generate lookupswitch over hash codes of String literals instead of a chain of conditional expressions. You can opt-in using the following import.įruit match case "apple" => 1 case "orange" => 2 case "banana" => 3 case _ => 0 It relies on the effects as implicit capabilities pattern. What’s new in 3.1 New experimental feature: safer exceptionsĪ new experimental feature that allows declaring and checking which exceptions can be thrown. You can find an example of build that follows this recommendation here. This will allow downstream users to use your library even if they can’t update to Scala 3.1.0.

In the meantime, we recommend testing your library with Scala 3.1.0 and 3.0.2, but publishing it with 3.0.2. We are actively working on technical solutions to support forward-compatibility in 3.2.0. We understand that the current state of binary compatibility may be unsatisfactory. If you are a library maintainer, updating to 3.1.0 will force all of your users to update to 3.1.0 as well. You will still be able to use dependencies compiled with Scala 3.0. This means that if you are an application developer, you can confidently update the compiler version to take advantage of the newest improvements.

