You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: library/src/scala/quoted/Exprs.scala
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,11 @@ object Exprs:
5
5
/** Matches literal sequence of literal constant value expressions and return a sequence of values.
6
6
*
7
7
* Usage:
8
-
* ```scala sc:nocompile
8
+
* ```scala sc:macrocompile
9
9
* inline def sum(args: Int*): Int = ${ sumExpr('args) }
10
10
* def sumExpr(argsExpr: Expr[Seq[Int]])(using Quotes): Expr[Int] = argsExpr match
11
-
* case Varargs(Exprs(args)) =>
12
-
* case Varargs(Exprs(args)) =>
11
+
* case Varargs(Exprs(args)) => ???
13
12
* // args: Seq[Int]
14
-
* ...
15
-
* }
16
13
* ```
17
14
* To directly get the value of all expressions in a sequence `exprs: Seq[Expr[T]]` consider using `exprs.map(_.value)`/`exprs.map(_.valueOrError)` instead.
0 commit comments