Trait

zio.blocks.codegen.ir.Trait
final case class Trait(name: String, typeParams: List[TypeParam] = ..., extendsTypes: List[TypeRef] = ..., members: List[ObjectMember] = ..., annotations: List[Annotation] = ..., companion: Option[CompanionObject] = ..., doc: Option[String] = ..., selfType: Option[TypeRef] = ...) extends TypeDefinition

Represents a non-sealed Scala trait in the IR.

Value parameters

annotations

Annotations on the trait (defaults to empty list)

companion

Optional companion object (defaults to None)

doc

Optional documentation (defaults to None)

extendsTypes

Types that this trait extends (defaults to empty list)

members

Members defined within the trait body (defaults to empty list)

name

The name of the trait

typeParams

Type parameters for generic traits (defaults to empty list)

Attributes

Example
val hasId = Trait(
 "HasId",
 members = List(
   ObjectMember.DefMember(Method("id", TypeRef.Long))
 )
)
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