docs.scala-lang
docs.scala-lang copied to clipboard
Control structures: Add example for `@switch` annotations
In Scala 3 Book, under Control Structures, the box under match expressions recommends using @switch annotation for improved performance. But it doesn't specify the syntax. Also, it's a bit confusing to bring up annotations without introducing what they are in "Taste of Scala" chapter.
The @switch note box should give a one-liner or a complete example on how to use those annotations.