Scala 3 Reference
3.5.0
Learn
Install
Playground
Find A Library
Community
Blog
Scala 3 Reference
Learn
Install
Playground
Find A Library
Community
Blog
Docs
New Types
Intersection Types
Union Types
Type Lambdas
Match Types
Dependent Function Types
Polymorphic Function Types
Enums
Enumerations
Algebraic Data Types
Translation of Enums and ADTs
Contextual Abstractions
Given Instances
Using Clauses
Context Bounds
Importing Givens
Extension Methods
Right-Associative Extension Methods: Details
Implementing Type classes
Type Class Derivation
How to write a type class `derived` method using macros
Multiversal Equality
Context Functions
Implicit Conversions
By-Name Context Parameters
Relationship with Scala 2 Implicits
Metaprogramming
Inline
Compile-time operations
Macros
Run-Time Multi-Stage Programming
Reflection
TASTy Inspection
The Meta-theory of Symmetric Metaprogramming
Other New Features
Trait Parameters
Transparent Traits and Classes
Universal Apply Methods
Export Clauses
Opaque Type Aliases
Opaque Type Aliases: More Details
Open Classes
Parameter Untupling
Kind Polymorphism
The Matchable Trait
The @threadUnsafe annotation
The @targetName annotation
New Control Syntax
Optional Braces
Safe Initialization
TypeTest
Experimental Definitions
Binary Integer Literals
Other Changed Features
Numeric Literals
Programmatic Structural Types
Rules for Operators
Wildcard Arguments in Types
Imports
Changes in Type Inference
Changes in Implicit Resolution
Implicit Conversions
Changes in Overload Resolution
Match Expressions
Vararg Splices
Pattern Bindings
Option-less pattern matching
Automatic Eta Expansion
Changes in Compiler Plugins
Lazy Vals Initialization
Main Methods
Escapes in interpolations
Dropped Features
Dropped: DelayedInit
Dropped: Scala 2 Macros
Dropped: Existential Types
Dropped: General Type Projection
Dropped: Do-While
Dropped: Procedure Syntax
Dropped: Package Objects
Dropped: Early Initializers
Dropped: Class Shadowing
Dropped: Limit 22
Dropped: XML Literals
Dropped: Symbol Literals
Dropped: Auto-Application
Dropped: Weak Conformance
Deprecated: Nonlocal Returns
Dropped: private[this] and protected[this]
Dropped: Wildcard Initializer
Experimental
CanThrow Capabilities
Erased Definitions
Named Type Arguments
Numeric Literals
Explicit Nulls
MainAnnotation
Capture Checking
Tupled Function
Scala 3 Syntax Summary
Language Versions
Source Compatibility
Binary Compatibility
Soft Keywords
A Classification of Proposed Language Features
Scala 3 Reference
/
Enums
Enums
This chapter documents enums in Scala 3.
Table of Contents
Enumerations
Algebraic Data Types
Translation of Enums and ADTs
Previous
Polymorphic Function Types
Next
Enumerations