File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
library/src-scala3/scala/quoted
tests/run-separate-compilation/xml-interpolation-2 Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,13 @@ package object quoted {
66 def toExpr (implicit ev : Liftable [T ]): Expr [T ] = ev.toExpr(x)
77 }
88
9+ implicit class ListOfExprOps [T ](val list : List [Expr [T ]]) extends AnyVal {
10+ def toExprOfList (implicit ev : Type [T ]): Expr [List [T ]] = {
11+ def rec (list : List [Expr [T ]]): Expr [List [T ]] = list match {
12+ case x :: xs => ' { (~ x) :: (~ rec(xs)) }
13+ case Nil => '(Nil)
14+ }
15+ rec(list)
16+ }
17+ }
918}
Original file line number Diff line number Diff line change @@ -56,11 +56,7 @@ object XmlQuote {
5656 // [a0, ...]: Any*
5757 val args2 : Expr [List [Any ]] = args.unseal.underlyingArgument match {
5858 case Typed (Repeated (args0), _) => // statically known args, make list directly
59- def liftListOfAny (lst : List [Expr [Any ]]): Expr [List [Any ]] = lst match {
60- case x :: xs => ' { ~ x :: ~ liftListOfAny(xs) }
61- case Nil => '(Nil)
62- }
63- liftListOfAny(args0.map(_.seal[Any ]))
59+ args0.map(_.seal[Any ]).toExprOfList
6460 case _ =>
6561 '((~args).toList)
6662
You can’t perform that action at this time.
0 commit comments