Enum
zio.blocks.codegen.ir.Enum
final case class Enum(name: String, cases: List[EnumCase], typeParams: List[TypeParam] = ..., extendsTypes: List[TypeRef] = ..., derives: List[String] = ..., annotations: List[Annotation] = ..., companion: Option[CompanionObject] = ..., doc: Option[String] = ...) extends TypeDefinition
Represents a Scala 3 enum in the IR.
Value parameters
- annotations
-
Annotations on the enum (defaults to empty list)
- cases
-
The enum cases
- doc
-
Optional documentation (defaults to None)
- extendsTypes
-
Types that this enum extends (defaults to empty list)
- name
-
The name of the enum
Attributes
- Example
-
val color = Enum( "Color", cases = List( EnumCase.SimpleCase("Red"), EnumCase.SimpleCase("Green"), EnumCase.SimpleCase("Blue") ) ) - Source
- TypeDefinition.scala
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass Any
Members list
In this article