OpaqueType

zio.blocks.codegen.ir.OpaqueType
final case class OpaqueType(name: String, underlyingType: TypeRef, upperBound: Option[TypeRef] = ..., annotations: List[Annotation] = ..., companion: Option[CompanionObject] = ..., doc: Option[String] = ...) extends TypeDefinition

Represents a Scala 3 opaque type alias in the IR.

In Scala 3, emitted as opaque type Name = UnderlyingType. In Scala 2, falls back to a plain type alias type Name = UnderlyingType.

Value parameters

annotations

Annotations on the opaque type (defaults to empty list)

companion

Optional companion object (defaults to None)

doc

Optional documentation (defaults to None)

name

The name of the opaque type

underlyingType

The underlying type being aliased

upperBound

Optional upper bound constraint (defaults to None)

Attributes

Example
val userId = OpaqueType("UserId", underlyingType = TypeRef.String)
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