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