Currently not directly possible to specify type bounds in quotes type pattern.
inline def foo[T]: Unit = ${ fooImpl[T] }
private def fooImpl[T](using q: Quotes, tpe: Type[T]): Expr[Unit] = {
import q.reflect.*
tpe match {
case ev @ '[t <: Product] =>
???
}
}
Raise following error:
31 | case ev @ '[t <: Product] =>
| ^^
| ']' expected, but '<:' found
Quotes type pattern can support type bounds as below, but not directly:
type IsProduct[U <: Product] = U
tpe match {
case ev @ '[IsProduct[t]] =>
???
}