-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Compiler version
3.1.2-RC1-bin-20211025-968dd1b-NIGHTLY
Minimized code
import scala.quoted.*
def printallImpl[T <: NonEmptyTuple](xs: Expr[T])(using Quotes): Expr[Unit] =
xs match
case '{ $head *: (${tail}: Tuple) } =>
'{ print($head); print(" *: "); println($tail) }
case '{ ($fst, $snd) } =>
'{ print($fst); print(", "); println($snd) }
inline def printall[T <: NonEmptyTuple](inline xs: T) = ${ printallImpl('{xs}) }@main def example = printall((1, 2))Output
1, 2Expectation
1 *: Tuple(2)I expect '{ $head *: (${tail}: Tuple) } to catch something matching '{ ($fst, $snd) }, but I'm new to this area.
Metadata
Metadata
Assignees
Labels
No labels