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 Serializabletrait Producttrait Equalstrait TypeDefinitionclass Objecttrait Matchableclass Any
Members list
In this article