TypeParam

zio.blocks.codegen.ir.TypeParam
final case class TypeParam(name: String, variance: Variance = ..., upperBound: Option[TypeRef] = ..., lowerBound: Option[TypeRef] = ..., typeParams: List[TypeParam] = ..., contextBounds: List[TypeRef] = ...)

Represents a type parameter in the IR, with optional variance and bounds.

Value parameters

name

The name of the type parameter (e.g., "A", "B")

upperBound

An optional upper bound type (e.g., Some(TypeRef("Serializable")) for A : Nothing)

variance

The variance of the type parameter (defaults to Invariant)

Attributes

Example
// Simple invariant type param
val a = TypeParam("A")
// Covariant type param
val covariant = TypeParam("A", Variance.Covariant)
// With upper bound
val bounded = TypeParam("A", upperBound = Some(TypeRef("Serializable")))
Source
TypeParam.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