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 Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala