Skip to content

Control structures: Add example for @switch annotations #2277

@arkivm

Description

@arkivm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions