docs.scala-lang icon indicating copy to clipboard operation
docs.scala-lang copied to clipboard

Control structures: Add example for `@switch` annotations

Open arkivm opened this issue 3 years ago • 0 comments

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.

arkivm avatar Dec 18 '21 05:12 arkivm