Skip to content

Commit 3d0fbef

Browse files
committed
Slightly improved varargs
1 parent 663d334 commit 3d0fbef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/src/scala/quoted/Varargs.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ object Varargs {
3939
def unapply[T](expr: Expr[Seq[T]])(using Quotes): Option[Seq[Expr[T]]] = {
4040
import quotes.reflect._
4141
def rec(tree: Term): Option[Seq[Expr[T]]] = tree match {
42-
case Typed(Repeated(elems, _), _) => Some(elems.map(x => x.asExpr.asInstanceOf[Expr[T]]))
42+
case Repeated(elems, _) => Some(elems.map(x => x.asExpr.asInstanceOf[Expr[T]]))
43+
case Typed(e, _) => rec(e)
4344
case Block(Nil, e) => rec(e)
4445
case Inlined(_, Nil, e) => rec(e)
4546
case _ => None

0 commit comments

Comments
 (0)