MatchBuilder

oxygen.meta.MatchBuilder
See theMatchBuilder companion object
final case class MatchBuilder[+I, +O](cases: Growable[Case[I, O]])

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def matchOn(i: Expr[I])(using Quotes, Type[I], Type[O]): Expr[O]
Extension method from MatchBuilder
def matchOn[I1 : Type, I2 : Type](i1: Expr[I1], i2: Expr[I2])(using evidence$1: Type[I1], evidence$2: Type[I2], Quotes, Type[I], Type[O], (I1, I2) <:< I): Expr[O]
Extension method from MatchBuilder
def matchOn[I1 : Type, I2 : Type, I3 : Type](i1: Expr[I1], i2: Expr[I2], i3: Expr[I3])(using evidence$1: Type[I1], evidence$2: Type[I2], evidence$3: Type[I3], Quotes, Type[I], Type[O], (I1, I2, I3) <:< I): Expr[O]
Extension method from MatchBuilder
def matchOn[I1 : Type, I2 : Type, I3 : Type, I4 : Type](i1: Expr[I1], i2: Expr[I2], i3: Expr[I3], i4: Expr[I4])(using evidence$1: Type[I1], evidence$2: Type[I2], evidence$3: Type[I3], evidence$4: Type[I4], Quotes, Type[I], Type[O], (I1, I2, I3, I4) <:< I): Expr[O]
Extension method from MatchBuilder
def matchOn[I1 : Type, I2 : Type, I3 : Type, I4 : Type, I5 : Type](i1: Expr[I1], i2: Expr[I2], i3: Expr[I3], i4: Expr[I4], i5: Expr[I5])(using evidence$1: Type[I1], evidence$2: Type[I2], evidence$3: Type[I3], evidence$4: Type[I4], evidence$5: Type[I5], Quotes, Type[I], Type[O], (I1, I2, I3, I4, I5) <:< I): Expr[O]
Extension method from MatchBuilder

It seems the compiler might not figure out when a match is exhaustive. Adding this case fixes that.

It seems the compiler might not figure out when a match is exhaustive. Adding this case fixes that.

case unknown => throw new MatchError(unknown)

Attributes

def withWildcard[O2 >: O](rhs: Quotes ?=> Expr[O2]): MatchBuilder[I, O2]

Add an else case to your match statement.

Add an else case to your match statement.

case _ => $rhs

Attributes

def ||[I2 >: I, O2 >: O](that: MatchBuilder[I2, O2]): MatchBuilder[I2, O2]

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product