diff --git a/docs/docs/reference/changed-features/numeric-literals.md b/docs/docs/reference/changed-features/numeric-literals.md index f53fe44b8dbe..f09396c333b7 100644 --- a/docs/docs/reference/changed-features/numeric-literals.md +++ b/docs/docs/reference/changed-features/numeric-literals.md @@ -206,7 +206,7 @@ implementation method `fromDigitsImpl`. Here is its definition: case Const(ds) => try { val BigFloat(m, e) = apply(ds) - '{BigFloat(${Expr(m)}, ${Expr(e)})} + '{BigFloat(${Lifted(m)}, ${Lifted(e)})} } catch { case ex: FromDigits.FromDigitsException => diff --git a/docs/docs/reference/contextual/derivation-macro.md b/docs/docs/reference/contextual/derivation-macro.md index 1b5a2b0dfec6..449eac057b4e 100644 --- a/docs/docs/reference/contextual/derivation-macro.md +++ b/docs/docs/reference/contextual/derivation-macro.md @@ -50,10 +50,10 @@ given derived[T: Type](using qctx: QuoteContext) as Expr[Eq[T]] = { case '{ $m: Mirror.ProductOf[T] { type MirroredElemTypes = $elementTypes }} => val elemInstances = summonAll(elementTypes) val eqProductBody: (Expr[T], Expr[T]) => Expr[Boolean] = (x, y) => { - elemInstances.zipWithIndex.foldLeft(Expr(true: Boolean)) { + elemInstances.zipWithIndex.foldLeft(Lifted(true: Boolean)) { case (acc, (elem, index)) => - val e1 = '{$x.asInstanceOf[Product].productElement(${Expr(index)})} - val e2 = '{$y.asInstanceOf[Product].productElement(${Expr(index)})} + val e1 = '{$x.asInstanceOf[Product].productElement(${Lifted(index)})} + val e2 = '{$y.asInstanceOf[Product].productElement(${Lifted(index)})} '{ $acc && $elem.asInstanceOf[Eq[Any]].eqv($e1, $e2) } } @@ -184,10 +184,10 @@ object Eq { case '{ $m: Mirror.ProductOf[T] { type MirroredElemTypes = $elementTypes }} => val elemInstances = summonAll(elementTypes) val eqProductBody: (Expr[T], Expr[T]) => Expr[Boolean] = (x, y) => { - elemInstances.zipWithIndex.foldLeft(Expr(true: Boolean)) { + elemInstances.zipWithIndex.foldLeft(Lifted(true: Boolean)) { case (acc, (elem, index)) => - val e1 = '{$x.asInstanceOf[Product].productElement(${Expr(index)})} - val e2 = '{$y.asInstanceOf[Product].productElement(${Expr(index)})} + val e1 = '{$x.asInstanceOf[Product].productElement(${Lifted(index)})} + val e2 = '{$y.asInstanceOf[Product].productElement(${Lifted(index)})} '{ $acc && $elem.asInstanceOf[Eq[Any]].eqv($e1, $e2) } } diff --git a/docs/docs/reference/metaprogramming/macros.md b/docs/docs/reference/metaprogramming/macros.md index e6b85438a132..a3a55f92a504 100644 --- a/docs/docs/reference/metaprogramming/macros.md +++ b/docs/docs/reference/metaprogramming/macros.md @@ -225,7 +225,7 @@ import scala.quoted.{given _, _} def compile(e: Exp, env: Map[String, Expr[Int]])(using QuoteContext): Expr[Int] = e match { case Num(n) => - Expr(n) + Lifted(n) case Plus(e1, e2) => '{ ${ compile(e1, env) } + ${ compile(e2, env) } } case Var(x) => @@ -238,19 +238,19 @@ Running `compile(letExp, Map())` would yield the following Scala code: ```scala '{ val y = 3; (2 + y) + 4 } ``` -The body of the first clause, `case Num(n) => Expr(n)`, looks suspicious. `n` -is declared as an `Int`, yet it is converted to an `Expr[Int]` with `Expr()`. +The body of the first clause, `case Num(n) => Lifted(n)`, looks suspicious. `n` +is declared as an `Int`, yet it is converted to an `Expr[Int]` with `Lifted()`. Shouldn’t `n` be quoted? In fact this would not work since replacing `n` by `'n` in the clause would not be phase correct. -The `Expr.apply` method is defined in package `quoted`: +The `Lifted.apply` method is defined in package `quoted`: ```scala package quoted -object Expr { +object Lifted { ... - def apply[T: Liftable](x: T)(using QuoteContext): Expr[T] = summon[Liftable[T]].toExpr(x) + def apply[T](x: T)(using qctx: QuoteContext, lift: Liftable[T]): Expr[T] = lift.toExpr(x) ... } ``` @@ -291,7 +291,7 @@ a `List` is liftable if its element type is: ```scala given [T: Liftable : Type] as Liftable[List[T]] { def toExpr(xs: List[T]) = xs match { - case head :: tail => '{ ${ Expr(head) } :: ${ toExpr(tail) } } + case head :: tail => '{ ${ Lifted(head) } :: ${ toExpr(tail) } } case Nil => '{ Nil: List[T] } } } @@ -306,13 +306,13 @@ Using lifting, we can now give the missing definition of `showExpr` in the intro ```scala def showExpr[T](expr: Expr[T])(using QuoteContext): Expr[String] = { val code: String = expr.show - Expr(code) + Lifted(code) } ``` That is, the `showExpr` method converts its `Expr` argument to a string (`code`), and lifts -the result back to an `Expr[String]` using `Expr.apply`. +the result back to an `Expr[String]` using `Lifted.apply`. -**Note**: Lifting `String` to `Expr[String]` using `Expr(code)` can be omitted by importing an implicit +**Note**: Lifting `String` to `Expr[String]` using `Lifted(code)` can be omitted by importing an implicit conversion with `import scala.quoted.autolift.given`. The programmer is able to declutter slightly the code at the cost of readable _phase distinction_ between stages. @@ -617,7 +617,7 @@ It is possible to deconstruct or extract values out of `Expr` using pattern matc `scala.quoted` contains objects that can help extracting values from `Expr`. * `scala.quoted.Const`/`scala.quoted.Consts`: matches an expression of a literal value (or list of values) and returns the value (or list of values). -* `scala.quoted.Value`/`scala.quoted.Values`: matches an expression of a value (or list of values) and returns the value (or list of values). +* `scala.quoted.Unlifted`: matches an expression of a value (or list of values) and returns the value (or list of values). * `scala.quoted.Varargs`: matches an explicit sequence of expresions and returns them. These sequences are useful to get individual `Expr[T]` out of a varargs expression of type `Expr[Seq[T]]`. These could be used in the following way to optimize any call to `sum` that has statically known values. @@ -625,7 +625,7 @@ These could be used in the following way to optimize any call to `sum` that has inline def sum(inline args: Int*): Int = ${ sumExpr('args) } private def sumExpr(argsExpr: Expr[Seq[Int]])(using QuoteContext): Expr[Int] = argsExpr match { case Varargs(Consts(args)) => // args is of type Seq[Int] - Expr(args.sum) // precompute result of sum + Lifted(args.sum) // precompute result of sum case Varargs(argExprs) => // argExprs is of type Seq[Expr[Int]] val staticSum: Int = argExprs.map { case Const(arg) => arg @@ -635,7 +635,7 @@ private def sumExpr(argsExpr: Expr[Seq[Int]])(using QuoteContext): Expr[Int] = a case Const(_) => false case arg => true } - dynamicSum.foldLeft(Expr(staticSum))((acc, arg) => '{ $acc + $arg }) + dynamicSum.foldLeft(Lifted(staticSum))((acc, arg) => '{ $acc + $arg }) case _ => '{ $argsExpr.sum } } @@ -658,7 +658,7 @@ def sum(args: Int*): Int = args.sum inline def optimize(arg: Int): Int = ${ optimizeExpr('arg) } private def optimizeExpr(body: Expr[Int])(using QuoteContext): Expr[Int] = body match { // Match a call to sum without any arguments - case '{ sum() } => Expr(0) + case '{ sum() } => Lifted(0) // Match a call to sum with an argument $n of type Int. n will be the Expr[Int] representing the argument. case '{ sum($n) } => n // Match a call to sum and extracts all its args in an `Expr[Seq[Int]]` @@ -679,7 +679,7 @@ private def sumExpr(args1: Seq[Expr[Int]])(using QuoteContext): Expr[Int] = { case Const(_) => false case arg => true } - dynamicSum.foldLeft(Expr(staticSum))((acc, arg) => '{ $acc + $arg }) + dynamicSum.foldLeft(Lifted(staticSum))((acc, arg) => '{ $acc + $arg }) } ``` diff --git a/docs/docs/reference/metaprogramming/tasty-reflect.md b/docs/docs/reference/metaprogramming/tasty-reflect.md index b5ac80194972..fb92ce59ca99 100644 --- a/docs/docs/reference/metaprogramming/tasty-reflect.md +++ b/docs/docs/reference/metaprogramming/tasty-reflect.md @@ -65,7 +65,7 @@ The method `qctx.tasty.Term.seal` provides a way to go back to a `quoted.Expr[Any]`. Note that the type is `Expr[Any]`. Consequently, the type must be set explicitly with a checked `cast` call. If the type does not conform to it an exception will be thrown. In the code above, we could have replaced -`Expr(n)` by `xTree.seal.cast[Int]`. +`Lifted(n)` by `xTree.seal.cast[Int]`. ### Obtaining the underlying argument diff --git a/library/src-bootstrapped/dotty/internal/StringContextMacro.scala b/library/src-bootstrapped/dotty/internal/StringContextMacro.scala index 33ff256d6284..7e93bf1510ce 100644 --- a/library/src-bootstrapped/dotty/internal/StringContextMacro.scala +++ b/library/src-bootstrapped/dotty/internal/StringContextMacro.scala @@ -721,6 +721,6 @@ object StringContextMacro { } // macro expansion - '{(${Expr(parts.mkString)}).format(${argsExpr}: _*)} + '{(${Lifted(parts.mkString)}).format(${argsExpr}: _*)} } } diff --git a/library/src/scala/internal/quoted/showName.scala b/library/src/scala/internal/quoted/showName.scala index 39e3dd0b591a..038c0fd1e08a 100644 --- a/library/src/scala/internal/quoted/showName.scala +++ b/library/src/scala/internal/quoted/showName.scala @@ -6,7 +6,7 @@ package scala.internal.quoted * Usage: * ```scala * def let(name: String)(value: Expr[Int])(in: Expr[Int] => Expr[Int]): Expr[Int] = '{ - * @showName(${Expr(name)}) + * @showName(${Lifted(name)}) * val x = $value * ${ in('x) } * } diff --git a/library/src/scala/quoted/Expr.scala b/library/src/scala/quoted/Expr.scala index 9087c30bf2a6..8ae9a1966dc1 100644 --- a/library/src/scala/quoted/Expr.scala +++ b/library/src/scala/quoted/Expr.scala @@ -97,8 +97,9 @@ object Expr { Block(statements.map(_.unseal), expr.unseal).seal.asInstanceOf[Expr[T]] } - /** Lift a value into an expression containing the construction of that value */ - def apply[T](x: T)(using qctx: QuoteContext, lift: Liftable[T]): Expr[T] = lift.toExpr(x) + // /** Lift a value into an expression containing the construction of that value */ + // @deprecated("Use scala.quoted.Lifted", "0.23") + // def apply[T](x: T)(using qctx: QuoteContext, lift: Liftable[T]): Expr[T] = Lifted(x) /** Lifts this sequence of expressions into an expression of a sequence * diff --git a/library/src/scala/quoted/Liftable.scala b/library/src/scala/quoted/Liftable.scala index 33e627dd9067..22ad3a218fd0 100644 --- a/library/src/scala/quoted/Liftable.scala +++ b/library/src/scala/quoted/Liftable.scala @@ -47,60 +47,60 @@ object Liftable { given ClassTagIsLiftable[T: Type] as Liftable[ClassTag[T]] = new Liftable[ClassTag[T]] { def toExpr(ct: ClassTag[T]): QuoteContext ?=> Expr[ClassTag[T]] = - '{ ClassTag[T](${Expr(ct.runtimeClass.asInstanceOf[Class[T]])}) } + '{ ClassTag[T](${Lifted(ct.runtimeClass.asInstanceOf[Class[T]])}) } } given ArrayIsLiftable[T: Type: Liftable: ClassTag] as Liftable[Array[T]] = new Liftable[Array[T]] { def toExpr(arr: Array[T]): QuoteContext ?=> Expr[Array[T]] = - '{ Array[T](${Expr(arr.toSeq)}: _*)(${Expr(summon[ClassTag[T]])}) } + '{ Array[T](${Lifted(arr.toSeq)}: _*)(${Lifted(summon[ClassTag[T]])}) } } given ArrayOfBooleanIsLiftable as Liftable[Array[Boolean]] = new Liftable[Array[Boolean]] { def toExpr(array: Array[Boolean]): QuoteContext ?=> Expr[Array[Boolean]] = if (array.length == 0) '{ Array.emptyBooleanArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given ArrayOfByteIsLiftable as Liftable[Array[Byte]] = new Liftable[Array[Byte]] { def toExpr(array: Array[Byte]): QuoteContext ?=> Expr[Array[Byte]] = if (array.length == 0) '{ Array.emptyByteArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given ArrayOfShortIsLiftable as Liftable[Array[Short]] = new Liftable[Array[Short]] { def toExpr(array: Array[Short]): QuoteContext ?=> Expr[Array[Short]] = if (array.length == 0) '{ Array.emptyShortArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given ArrayOfCharIsLiftable as Liftable[Array[Char]] = new Liftable[Array[Char]] { def toExpr(array: Array[Char]): QuoteContext ?=> Expr[Array[Char]] = if (array.length == 0) '{ Array.emptyCharArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given ArrayOfIntIsLiftable as Liftable[Array[Int]] = new Liftable[Array[Int]] { def toExpr(array: Array[Int]): QuoteContext ?=> Expr[Array[Int]] = if (array.length == 0) '{ Array.emptyIntArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given ArrayOfLongIsLiftable as Liftable[Array[Long]] = new Liftable[Array[Long]] { def toExpr(array: Array[Long]): QuoteContext ?=> Expr[Array[Long]] = if (array.length == 0) '{ Array.emptyLongArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given ArrayOfFloatIsLiftable as Liftable[Array[Float]] = new Liftable[Array[Float]] { def toExpr(array: Array[Float]): QuoteContext ?=> Expr[Array[Float]] = if (array.length == 0) '{ Array.emptyFloatArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given ArrayOfDoubleIsLiftable as Liftable[Array[Double]] = new Liftable[Array[Double]] { def toExpr(array: Array[Double]): QuoteContext ?=> Expr[Array[Double]] = if (array.length == 0) '{ Array.emptyDoubleArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Lifted(array(0))}, ${Lifted(array.toSeq.tail)}: _*) } } given iArrayIsLiftable[T: Type](using ltArray: Liftable[Array[T]]) as Liftable[IArray[T]] { @@ -120,189 +120,189 @@ object Liftable { given [T: Type: Liftable] as Liftable[Set[T]] = new Liftable[Set[T]] { def toExpr(set: Set[T]): QuoteContext ?=> Expr[Set[T]] = - '{ Set(${Expr(set.toSeq)}: _*) } + '{ Set(${Lifted(set.toSeq)}: _*) } } given [T: Type: Liftable, U: Type: Liftable] as Liftable[Map[T, U]] = new Liftable[Map[T, U]] { def toExpr(map: Map[T, U]): QuoteContext ?=> Expr[Map[T, U]] = - '{ Map(${Expr(map.toSeq)}: _*) } + '{ Map(${Lifted(map.toSeq)}: _*) } } given [T: Type: Liftable] as Liftable[Option[T]] = new Liftable[Option[T]] { def toExpr(x: Option[T]): QuoteContext ?=> Expr[Option[T]] = x match { - case Some(x) => '{ Some[T](${Expr(x)}) } + case Some(x) => '{ Some[T](${Lifted(x)}) } case None => '{ None: Option[T] } } } given [L: Type: Liftable, R: Type: Liftable] as Liftable[Either[L, R]] = new Liftable[Either[L, R]] { def toExpr(x: Either[L, R]): QuoteContext ?=> Expr[Either[L, R]] = x match { - case Left(x) => '{ Left[L, R](${Expr(x)}) } - case Right(x) => '{ Right[L, R](${Expr(x)}) } + case Left(x) => '{ Left[L, R](${Lifted(x)}) } + case Right(x) => '{ Right[L, R](${Lifted(x)}) } } } given [T1: Type: Liftable] as Liftable[Tuple1[T1]] = new { def toExpr(tup: Tuple1[T1]) = - '{ Tuple1(${Expr(tup._1)}) } + '{ Tuple1(${Lifted(tup._1)}) } } given [T1: Type: Liftable, T2: Type: Liftable] as Liftable[Tuple2[T1, T2]] = new { def toExpr(tup: Tuple2[T1, T2]) = - '{ (${Expr(tup._1)}, ${Expr(tup._2)}) } + '{ (${Lifted(tup._1)}, ${Lifted(tup._2)}) } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable] as Liftable[Tuple3[T1, T2, T3]] = new { def toExpr(tup: Tuple3[T1, T2, T3]) = - '{ (${Expr(tup._1)}, ${Expr(tup._2)}, ${Expr(tup._3)}) } + '{ (${Lifted(tup._1)}, ${Lifted(tup._2)}, ${Lifted(tup._3)}) } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable] as Liftable[Tuple4[T1, T2, T3, T4]] = new { def toExpr(tup: Tuple4[T1, T2, T3, T4]) = - '{ (${Expr(tup._1)}, ${Expr(tup._2)}, ${Expr(tup._3)}, ${Expr(tup._4)}) } + '{ (${Lifted(tup._1)}, ${Lifted(tup._2)}, ${Lifted(tup._3)}, ${Lifted(tup._4)}) } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable] as Liftable[Tuple5[T1, T2, T3, T4, T5]] = new { def toExpr(tup: Tuple5[T1, T2, T3, T4, T5]) = { val (x1, x2, x3, x4, x5) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable] as Liftable[Tuple6[T1, T2, T3, T4, T5, T6]] = new { def toExpr(tup: Tuple6[T1, T2, T3, T4, T5, T6]) = { val (x1, x2, x3, x4, x5, x6) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable] as Liftable[Tuple7[T1, T2, T3, T4, T5, T6, T7]] = new { def toExpr(tup: Tuple7[T1, T2, T3, T4, T5, T6, T7]) = { val (x1, x2, x3, x4, x5, x6, x7) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable] as Liftable[Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] = new { def toExpr(tup: Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]) = { val (x1, x2, x3, x4, x5, x6, x7, x8) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable] as Liftable[Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] = new { def toExpr(tup: Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable] as Liftable[Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] = new { def toExpr(tup: Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable] as Liftable[Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]] = new { def toExpr(tup: Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable] as Liftable[Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]] = new { def toExpr(tup: Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable] as Liftable[Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]] = new { def toExpr(tup: Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable] as Liftable[Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]] = new { def toExpr(tup: Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable] as Liftable[Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]] = new { def toExpr(tup: Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable, T16: Type: Liftable] as Liftable[Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]] = new { def toExpr(tup: Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}, ${Expr(x16)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}, ${Lifted(x16)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable, T16: Type: Liftable, T17: Type: Liftable] as Liftable[Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]] = new { def toExpr(tup: Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}, ${Expr(x16)}, ${Expr(x17)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}, ${Lifted(x16)}, ${Lifted(x17)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable, T16: Type: Liftable, T17: Type: Liftable, T18: Type: Liftable] as Liftable[Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]] = new { def toExpr(tup: Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}, ${Expr(x16)}, ${Expr(x17)}, ${Expr(x18)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}, ${Lifted(x16)}, ${Lifted(x17)}, ${Lifted(x18)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable, T16: Type: Liftable, T17: Type: Liftable, T18: Type: Liftable, T19: Type: Liftable] as Liftable[Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]] = new { def toExpr(tup: Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}, ${Expr(x16)}, ${Expr(x17)}, ${Expr(x18)}, ${Expr(x19)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}, ${Lifted(x16)}, ${Lifted(x17)}, ${Lifted(x18)}, ${Lifted(x19)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable, T16: Type: Liftable, T17: Type: Liftable, T18: Type: Liftable, T19: Type: Liftable, T20: Type: Liftable] as Liftable[Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]] = new { def toExpr(tup: Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}, ${Expr(x16)}, ${Expr(x17)}, ${Expr(x18)}, ${Expr(x19)}, ${Expr(x20)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}, ${Lifted(x16)}, ${Lifted(x17)}, ${Lifted(x18)}, ${Lifted(x19)}, ${Lifted(x20)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable, T16: Type: Liftable, T17: Type: Liftable, T18: Type: Liftable, T19: Type: Liftable, T20: Type: Liftable, T21: Type: Liftable] as Liftable[Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]] = new { def toExpr(tup: Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}, ${Expr(x16)}, ${Expr(x17)}, ${Expr(x18)}, ${Expr(x19)}, ${Expr(x20)}, ${Expr(x21)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}, ${Lifted(x16)}, ${Lifted(x17)}, ${Lifted(x18)}, ${Lifted(x19)}, ${Lifted(x20)}, ${Lifted(x21)}) } } } given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable, T5: Type: Liftable, T6: Type: Liftable, T7: Type: Liftable, T8: Type: Liftable, T9: Type: Liftable, T10: Type: Liftable, T11: Type: Liftable, T12: Type: Liftable, T13: Type: Liftable, T14: Type: Liftable, T15: Type: Liftable, T16: Type: Liftable, T17: Type: Liftable, T18: Type: Liftable, T19: Type: Liftable, T20: Type: Liftable, T21: Type: Liftable, T22: Type: Liftable] as Liftable[Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]] = new { def toExpr(tup: Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]) = { val (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22) = tup - '{ (${Expr(x1)}, ${Expr(x2)}, ${Expr(x3)}, ${Expr(x4)}, ${Expr(x5)}, ${Expr(x6)}, ${Expr(x7)}, ${Expr(x8)}, ${Expr(x9)}, ${Expr(x10)}, ${Expr(x11)}, ${Expr(x12)}, ${Expr(x13)}, ${Expr(x14)}, ${Expr(x15)}, ${Expr(x16)}, ${Expr(x17)}, ${Expr(x18)}, ${Expr(x19)}, ${Expr(x20)}, ${Expr(x21)}, ${Expr(x22)}) } + '{ (${Lifted(x1)}, ${Lifted(x2)}, ${Lifted(x3)}, ${Lifted(x4)}, ${Lifted(x5)}, ${Lifted(x6)}, ${Lifted(x7)}, ${Lifted(x8)}, ${Lifted(x9)}, ${Lifted(x10)}, ${Lifted(x11)}, ${Lifted(x12)}, ${Lifted(x13)}, ${Lifted(x14)}, ${Lifted(x15)}, ${Lifted(x16)}, ${Lifted(x17)}, ${Lifted(x18)}, ${Lifted(x19)}, ${Lifted(x20)}, ${Lifted(x21)}, ${Lifted(x22)}) } } } given [H: Type: Liftable, T <: Tuple: Type: Liftable] as Liftable[H *: T] = new { def toExpr(tup: H *: T): QuoteContext ?=> Expr[H *: T] = '{ ${summon[Liftable[H]].toExpr(tup.head)} *: ${summon[Liftable[T]].toExpr(tup.tail)} } - // '{ ${Expr(tup.head)} *: ${Expr(tup.tail)} } // TODO figure out why this fails during CI documentation + // '{ ${Lifted(tup.head)} *: ${Lifted(tup.tail)} } // TODO figure out why this fails during CI documentation } given Liftable[BigInt] = new Liftable[BigInt] { def toExpr(x: BigInt): QuoteContext ?=> Expr[BigInt] = - '{ BigInt(${Expr(x.toByteArray)}) } + '{ BigInt(${Lifted(x.toByteArray)}) } } /** Lift a BigDecimal using the default MathContext */ given Liftable[BigDecimal] = new Liftable[BigDecimal] { def toExpr(x: BigDecimal): QuoteContext ?=> Expr[BigDecimal] = - '{ BigDecimal(${Expr(x.toString)}) } + '{ BigDecimal(${Lifted(x.toString)}) } } } diff --git a/library/src/scala/quoted/Lifted.scala b/library/src/scala/quoted/Lifted.scala new file mode 100644 index 000000000000..614e2a4573fc --- /dev/null +++ b/library/src/scala/quoted/Lifted.scala @@ -0,0 +1,10 @@ +package scala.quoted + +/** Lift expressions */ +object Lifted { + + /** Lift a value into an expression containing the construction of that value */ + def apply[T](x: T)(using qctx: QuoteContext, lift: Liftable[T]): Expr[T] = + lift.toExpr(x) + +} diff --git a/library/src/scala/quoted/Unliftable.scala b/library/src/scala/quoted/Unliftable.scala index 413d3c4eb6e3..8feb24c064ce 100644 --- a/library/src/scala/quoted/Unliftable.scala +++ b/library/src/scala/quoted/Unliftable.scala @@ -33,8 +33,8 @@ object Unliftable { given Option_delegate[T](using Type[T], Unliftable[T]) as Unliftable[Option[T]] = new { def apply(x: Expr[Option[T]])(using qctx: QuoteContext): Option[Option[T]] = x match { case '{ None: Option[T] } => Some(None) // FIXME: remove ascription, Matcher should be able to match this expression - case '{ new Some[T](${Value(y)}) } => Some(Some(y)) - case '{ Some[T](${Value(y)}) } => Some(Some(y)) + case '{ new Some[T](${Unlifted(y)}) } => Some(Some(y)) + case '{ Some[T](${Unlifted(y)}) } => Some(Some(y)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Option_delegate" @@ -52,8 +52,8 @@ object Unliftable { given Tuple1_delegate[T1](using Type[T1], Unliftable[T1]) as Unliftable[Tuple1[T1]] = new { def apply(x: Expr[Tuple1[T1]])(using qctx: QuoteContext): Option[Tuple1[T1]] = x match { - case '{ new Tuple1[T1](${Value(y)}) } => Some(Tuple1(y)) - case '{ Tuple1[T1](${Value(y)}) } => Some(Tuple1(y)) + case '{ new Tuple1[T1](${Unlifted(y)}) } => Some(Tuple1(y)) + case '{ Tuple1[T1](${Unlifted(y)}) } => Some(Tuple1(y)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple1_delegate" @@ -61,8 +61,8 @@ object Unliftable { given Tuple2_delegate[T1, T2](using Type[T1], Type[T2], Unliftable[T1], Unliftable[T2]) as Unliftable[Tuple2[T1, T2]] = new { def apply(x: Expr[Tuple2[T1, T2]])(using qctx: QuoteContext): Option[Tuple2[T1, T2]] = x match { - case '{ new Tuple2[T1, T2](${Value(y1)}, ${Value(y2)}) } => Some(Tuple2(y1, y2)) - case '{ Tuple2[T1, T2](${Value(y1)}, ${Value(y2)}) } => Some(Tuple2(y1, y2)) + case '{ new Tuple2[T1, T2](${Unlifted(y1)}, ${Unlifted(y2)}) } => Some(Tuple2(y1, y2)) + case '{ Tuple2[T1, T2](${Unlifted(y1)}, ${Unlifted(y2)}) } => Some(Tuple2(y1, y2)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple2_delegate" @@ -71,8 +71,8 @@ object Unliftable { given Tuple3_delegate[T1, T2, T3](using Type[T1], Type[T2], Type[T3], Unliftable[T1], Unliftable[T2], Unliftable[T3]) as Unliftable[Tuple3[T1, T2, T3]] = new { def apply(x: Expr[Tuple3[T1, T2, T3]])(using qctx: QuoteContext): Option[Tuple3[T1, T2, T3]] = x match { - case '{ new Tuple3[T1, T2, T3](${Value(y1)}, ${Value(y2)}, ${Value(y3)}) } => Some(Tuple3(y1, y2, y3)) - case '{ Tuple3[T1, T2, T3](${Value(y1)}, ${Value(y2)}, ${Value(y3)}) } => Some(Tuple3(y1, y2, y3)) + case '{ new Tuple3[T1, T2, T3](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}) } => Some(Tuple3(y1, y2, y3)) + case '{ Tuple3[T1, T2, T3](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}) } => Some(Tuple3(y1, y2, y3)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple3_delegate" @@ -81,8 +81,8 @@ object Unliftable { given Tuple4_delegate[T1, T2, T3, T4](using Type[T1], Type[T2], Type[T3], Type[T4], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4]) as Unliftable[Tuple4[T1, T2, T3, T4]] = new { def apply(x: Expr[Tuple4[T1, T2, T3, T4]])(using qctx: QuoteContext): Option[Tuple4[T1, T2, T3, T4]] = x match { - case '{ new Tuple4[T1, T2, T3, T4](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}) } => Some(Tuple4(y1, y2, y3, y4)) - case '{ Tuple4[T1, T2, T3, T4](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}) } => Some(Tuple4(y1, y2, y3, y4)) + case '{ new Tuple4[T1, T2, T3, T4](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}) } => Some(Tuple4(y1, y2, y3, y4)) + case '{ Tuple4[T1, T2, T3, T4](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}) } => Some(Tuple4(y1, y2, y3, y4)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple4_delegate" @@ -91,8 +91,8 @@ object Unliftable { given Tuple5_delegate[T1, T2, T3, T4, T5](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5]) as Unliftable[Tuple5[T1, T2, T3, T4, T5]] = new { def apply(x: Expr[Tuple5[T1, T2, T3, T4, T5]])(using qctx: QuoteContext): Option[Tuple5[T1, T2, T3, T4, T5]] = x match { - case '{ new Tuple5[T1, T2, T3, T4, T5](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}) } => Some(Tuple5(y1, y2, y3, y4, y5)) - case '{ Tuple5[T1, T2, T3, T4, T5](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}) } => Some(Tuple5(y1, y2, y3, y4, y5)) + case '{ new Tuple5[T1, T2, T3, T4, T5](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}) } => Some(Tuple5(y1, y2, y3, y4, y5)) + case '{ Tuple5[T1, T2, T3, T4, T5](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}) } => Some(Tuple5(y1, y2, y3, y4, y5)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple5_delegate" @@ -101,8 +101,8 @@ object Unliftable { given Tuple6_delegate[T1, T2, T3, T4, T5, T6](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6]) as Unliftable[Tuple6[T1, T2, T3, T4, T5, T6]] = new { def apply(x: Expr[Tuple6[T1, T2, T3, T4, T5, T6]])(using qctx: QuoteContext): Option[Tuple6[T1, T2, T3, T4, T5, T6]] = x match { - case '{ new Tuple6[T1, T2, T3, T4, T5, T6](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}) } => Some(Tuple6(y1, y2, y3, y4, y5, y6)) - case '{ Tuple6[T1, T2, T3, T4, T5, T6](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}) } => Some(Tuple6(y1, y2, y3, y4, y5, y6)) + case '{ new Tuple6[T1, T2, T3, T4, T5, T6](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}) } => Some(Tuple6(y1, y2, y3, y4, y5, y6)) + case '{ Tuple6[T1, T2, T3, T4, T5, T6](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}) } => Some(Tuple6(y1, y2, y3, y4, y5, y6)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple6_delegate" @@ -111,8 +111,8 @@ object Unliftable { given Tuple7_delegate[T1, T2, T3, T4, T5, T6, T7](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7]) as Unliftable[Tuple7[T1, T2, T3, T4, T5, T6, T7]] = new { def apply(x: Expr[Tuple7[T1, T2, T3, T4, T5, T6, T7]])(using qctx: QuoteContext): Option[Tuple7[T1, T2, T3, T4, T5, T6, T7]] = x match { - case '{ new Tuple7[T1, T2, T3, T4, T5, T6, T7](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}) } => Some(Tuple7(y1, y2, y3, y4, y5, y6, y7)) - case '{ Tuple7[T1, T2, T3, T4, T5, T6, T7](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}) } => Some(Tuple7(y1, y2, y3, y4, y5, y6, y7)) + case '{ new Tuple7[T1, T2, T3, T4, T5, T6, T7](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}) } => Some(Tuple7(y1, y2, y3, y4, y5, y6, y7)) + case '{ Tuple7[T1, T2, T3, T4, T5, T6, T7](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}) } => Some(Tuple7(y1, y2, y3, y4, y5, y6, y7)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple7_delegate" @@ -121,8 +121,8 @@ object Unliftable { given Tuple8_delegate[T1, T2, T3, T4, T5, T6, T7, T8](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8]) as Unliftable[Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] = new { def apply(x: Expr[Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]])(using qctx: QuoteContext): Option[Tuple8[T1, T2, T3, T4, T5, T6, T7, T8]] = x match { - case '{ new Tuple8[T1, T2, T3, T4, T5, T6, T7, T8](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}) } => Some(Tuple8(y1, y2, y3, y4, y5, y6, y7, y8)) - case '{ Tuple8[T1, T2, T3, T4, T5, T6, T7, T8](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}) } => Some(Tuple8(y1, y2, y3, y4, y5, y6, y7, y8)) + case '{ new Tuple8[T1, T2, T3, T4, T5, T6, T7, T8](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}) } => Some(Tuple8(y1, y2, y3, y4, y5, y6, y7, y8)) + case '{ Tuple8[T1, T2, T3, T4, T5, T6, T7, T8](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}) } => Some(Tuple8(y1, y2, y3, y4, y5, y6, y7, y8)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple8_delegate" @@ -131,8 +131,8 @@ object Unliftable { given Tuple9_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9]) as Unliftable[Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] = new { def apply(x: Expr[Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]])(using qctx: QuoteContext): Option[Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9]] = x match { - case '{ new Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}) } => Some(Tuple9(y1, y2, y3, y4, y5, y6, y7, y8, y9)) - case '{ Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}) } => Some(Tuple9(y1, y2, y3, y4, y5, y6, y7, y8, y9)) + case '{ new Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}) } => Some(Tuple9(y1, y2, y3, y4, y5, y6, y7, y8, y9)) + case '{ Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}) } => Some(Tuple9(y1, y2, y3, y4, y5, y6, y7, y8, y9)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple9_delegate" @@ -141,8 +141,8 @@ object Unliftable { given Tuple10_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10]) as Unliftable[Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] = new { def apply(x: Expr[Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]])(using qctx: QuoteContext): Option[Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]] = x match { - case '{ new Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}) } => Some(Tuple10(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10)) - case '{ Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}) } => Some(Tuple10(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10)) + case '{ new Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}) } => Some(Tuple10(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10)) + case '{ Tuple10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}) } => Some(Tuple10(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple10_delegate" @@ -151,8 +151,8 @@ object Unliftable { given Tuple11_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11]) as Unliftable[Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]] = new { def apply(x: Expr[Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]])(using qctx: QuoteContext): Option[Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]] = x match { - case '{ new Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}) } => Some(Tuple11(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11)) - case '{ Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}) } => Some(Tuple11(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11)) + case '{ new Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}) } => Some(Tuple11(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11)) + case '{ Tuple11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}) } => Some(Tuple11(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple11_delegate" @@ -161,8 +161,8 @@ object Unliftable { given Tuple12_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12]) as Unliftable[Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]] = new { def apply(x: Expr[Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]])(using qctx: QuoteContext): Option[Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]] = x match { - case '{ new Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}) } => Some(Tuple12(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12)) - case '{ Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}) } => Some(Tuple12(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12)) + case '{ new Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}) } => Some(Tuple12(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12)) + case '{ Tuple12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}) } => Some(Tuple12(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple12_delegate" @@ -171,8 +171,8 @@ object Unliftable { given Tuple13_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13]) as Unliftable[Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]] = new { def apply(x: Expr[Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]])(using qctx: QuoteContext): Option[Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]] = x match { - case '{ new Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}) } => Some(Tuple13(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13)) - case '{ Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}) } => Some(Tuple13(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13)) + case '{ new Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}) } => Some(Tuple13(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13)) + case '{ Tuple13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}) } => Some(Tuple13(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple13_delegate" @@ -181,8 +181,8 @@ object Unliftable { given Tuple14_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14]) as Unliftable[Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]] = new { def apply(x: Expr[Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]])(using qctx: QuoteContext): Option[Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]] = x match { - case '{ new Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}) } => Some(Tuple14(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14)) - case '{ Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}) } => Some(Tuple14(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14)) + case '{ new Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}) } => Some(Tuple14(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14)) + case '{ Tuple14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}) } => Some(Tuple14(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple14_delegate" @@ -191,8 +191,8 @@ object Unliftable { given Tuple15_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15]) as Unliftable[Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]] = new { def apply(x: Expr[Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]])(using qctx: QuoteContext): Option[Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]] = x match { - case '{ new Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}) } => Some(Tuple15(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15)) - case '{ Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}) } => Some(Tuple15(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15)) + case '{ new Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}) } => Some(Tuple15(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15)) + case '{ Tuple15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}) } => Some(Tuple15(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple15_delegate" @@ -201,8 +201,8 @@ object Unliftable { given Tuple16_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Type[T16], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15], Unliftable[T16]) as Unliftable[Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]] = new { def apply(x: Expr[Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]])(using qctx: QuoteContext): Option[Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]] = x match { - case '{ new Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}) } => Some(Tuple16(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16)) - case '{ Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}) } => Some(Tuple16(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16)) + case '{ new Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}) } => Some(Tuple16(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16)) + case '{ Tuple16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}) } => Some(Tuple16(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple16_delegate" @@ -211,8 +211,8 @@ object Unliftable { given Tuple17_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Type[T16], Type[T17], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15], Unliftable[T16], Unliftable[T17]) as Unliftable[Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]] = new { def apply(x: Expr[Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]])(using qctx: QuoteContext): Option[Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]] = x match { - case '{ new Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}) } => Some(Tuple17(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17)) - case '{ Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}) } => Some(Tuple17(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17)) + case '{ new Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}) } => Some(Tuple17(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17)) + case '{ Tuple17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}) } => Some(Tuple17(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple17_delegate" @@ -221,8 +221,8 @@ object Unliftable { given Tuple18_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Type[T16], Type[T17], Type[T18], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15], Unliftable[T16], Unliftable[T17], Unliftable[T18]) as Unliftable[Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]] = new { def apply(x: Expr[Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]])(using qctx: QuoteContext): Option[Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]] = x match { - case '{ new Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}) } => Some(Tuple18(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18)) - case '{ Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}) } => Some(Tuple18(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18)) + case '{ new Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}) } => Some(Tuple18(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18)) + case '{ Tuple18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}) } => Some(Tuple18(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple18_delegate" @@ -231,8 +231,8 @@ object Unliftable { given Tuple19_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Type[T16], Type[T17], Type[T18], Type[T19], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15], Unliftable[T16], Unliftable[T17], Unliftable[T18], Unliftable[T19]) as Unliftable[Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]] = new { def apply(x: Expr[Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]])(using qctx: QuoteContext): Option[Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]] = x match { - case '{ new Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}) } => Some(Tuple19(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19)) - case '{ Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}) } => Some(Tuple19(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19)) + case '{ new Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}) } => Some(Tuple19(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19)) + case '{ Tuple19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}) } => Some(Tuple19(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple19_delegate" @@ -241,8 +241,8 @@ object Unliftable { given Tuple20_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Type[T16], Type[T17], Type[T18], Type[T19], Type[T20], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15], Unliftable[T16], Unliftable[T17], Unliftable[T18], Unliftable[T19], Unliftable[T20]) as Unliftable[Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]] = new { def apply(x: Expr[Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]])(using qctx: QuoteContext): Option[Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]] = x match { - case '{ new Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}, ${Value(y20)}) } => Some(Tuple20(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20)) - case '{ Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}, ${Value(y20)}) } => Some(Tuple20(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20)) + case '{ new Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}, ${Unlifted(y20)}) } => Some(Tuple20(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20)) + case '{ Tuple20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}, ${Unlifted(y20)}) } => Some(Tuple20(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple20_delegate" @@ -251,8 +251,8 @@ object Unliftable { given Tuple21_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Type[T16], Type[T17], Type[T18], Type[T19], Type[T20], Type[T21], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15], Unliftable[T16], Unliftable[T17], Unliftable[T18], Unliftable[T19], Unliftable[T20], Unliftable[T21]) as Unliftable[Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]] = new { def apply(x: Expr[Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]])(using qctx: QuoteContext): Option[Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]] = x match { - case '{ new Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}, ${Value(y20)}, ${Value(y21)}) } => Some(Tuple21(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21)) - case '{ Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}, ${Value(y20)}, ${Value(y21)}) } => Some(Tuple21(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21)) + case '{ new Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}, ${Unlifted(y20)}, ${Unlifted(y21)}) } => Some(Tuple21(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21)) + case '{ Tuple21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}, ${Unlifted(y20)}, ${Unlifted(y21)}) } => Some(Tuple21(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple21_delegate" @@ -261,8 +261,8 @@ object Unliftable { given Tuple22_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](using Type[T1], Type[T2], Type[T3], Type[T4], Type[T5], Type[T6], Type[T7], Type[T8], Type[T9], Type[T10], Type[T11], Type[T12], Type[T13], Type[T14], Type[T15], Type[T16], Type[T17], Type[T18], Type[T19], Type[T20], Type[T21], Type[T22], Unliftable[T1], Unliftable[T2], Unliftable[T3], Unliftable[T4], Unliftable[T5], Unliftable[T6], Unliftable[T7], Unliftable[T8], Unliftable[T9], Unliftable[T10], Unliftable[T11], Unliftable[T12], Unliftable[T13], Unliftable[T14], Unliftable[T15], Unliftable[T16], Unliftable[T17], Unliftable[T18], Unliftable[T19], Unliftable[T20], Unliftable[T21], Unliftable[T22]) as Unliftable[Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]] = new { def apply(x: Expr[Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]])(using qctx: QuoteContext): Option[Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]] = x match { - case '{ new Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}, ${Value(y20)}, ${Value(y21)}, ${Value(y22)}) } => Some(Tuple22(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21, y22)) - case '{ Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](${Value(y1)}, ${Value(y2)}, ${Value(y3)}, ${Value(y4)}, ${Value(y5)}, ${Value(y6)}, ${Value(y7)}, ${Value(y8)}, ${Value(y9)}, ${Value(y10)}, ${Value(y11)}, ${Value(y12)}, ${Value(y13)}, ${Value(y14)}, ${Value(y15)}, ${Value(y16)}, ${Value(y17)}, ${Value(y18)}, ${Value(y19)}, ${Value(y20)}, ${Value(y21)}, ${Value(y22)}) } => Some(Tuple22(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21, y22)) + case '{ new Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}, ${Unlifted(y20)}, ${Unlifted(y21)}, ${Unlifted(y22)}) } => Some(Tuple22(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21, y22)) + case '{ Tuple22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](${Unlifted(y1)}, ${Unlifted(y2)}, ${Unlifted(y3)}, ${Unlifted(y4)}, ${Unlifted(y5)}, ${Unlifted(y6)}, ${Unlifted(y7)}, ${Unlifted(y8)}, ${Unlifted(y9)}, ${Unlifted(y10)}, ${Unlifted(y11)}, ${Unlifted(y12)}, ${Unlifted(y13)}, ${Unlifted(y14)}, ${Unlifted(y15)}, ${Unlifted(y16)}, ${Unlifted(y17)}, ${Unlifted(y18)}, ${Unlifted(y19)}, ${Unlifted(y20)}, ${Unlifted(y21)}, ${Unlifted(y22)}) } => Some(Tuple22(y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19, y20, y21, y22)) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Tuple22_delegate" @@ -270,9 +270,9 @@ object Unliftable { given Seq_delegate[T](using Type[T], Unliftable[T]) as Unliftable[Seq[T]] = new { def apply(x: Expr[Seq[T]])(using qctx: QuoteContext): Option[Seq[T]] = x match { - case Varargs(Values(elems)) => Some(elems) - case '{ scala.collection.Seq[T](${Varargs(Values(elems))}: _*) } => Some(elems) - case '{ scala.collection.immutable.Seq[T](${Varargs(Values(elems))}: _*) } => Some(elems) + case Varargs(Unlifted(elems)) => Some(elems) + case '{ scala.collection.Seq[T](${Varargs(Unlifted(elems))}: _*) } => Some(elems) + case '{ scala.collection.immutable.Seq[T](${Varargs(Unlifted(elems))}: _*) } => Some(elems) case _ => None } override def toString(): String = "scala.quoted.Unliftable.Seq_delegate" diff --git a/library/src/scala/quoted/Values.scala b/library/src/scala/quoted/Unlifted.scala similarity index 57% rename from library/src/scala/quoted/Values.scala rename to library/src/scala/quoted/Unlifted.scala index 8478309c617e..569b92b64026 100644 --- a/library/src/scala/quoted/Values.scala +++ b/library/src/scala/quoted/Unlifted.scala @@ -1,7 +1,19 @@ package scala.quoted -/** Value expressions */ -object Values { +/** Unlift expressions */ +object Unlifted { + + /** Matches expressions containing values and extracts the value. + * + * Usage: + * ``` + * (x: Expr[B]) match { + * case Unlifted(value) => ... // value: B + * } + * ``` + */ + def unapply[T](expr: Expr[T])(using unlift: Unliftable[T], qxtc: QuoteContext): Option[T] = + unlift(expr) /** Matches literal sequence of literal constant value expressions and return a sequence of values. * @@ -9,7 +21,7 @@ object Values { * ```scala * inline def sum(args: Int*): Int = ${ sumExpr('args) } * def sumExpr(argsExpr: Expr[Seq[Int]])(using QuoteContext): Expr[Int] = argsExpr match - * case Varargs(Values(args)) => + * case Varargs(Unlifted(args)) => * // args: Seq[Int] * ... * } @@ -18,7 +30,7 @@ object Values { def unapply[T](exprs: Seq[Expr[T]])(using unlift: Unliftable[T], qctx: QuoteContext): Option[Seq[T]] = exprs.foldRight(Option(List.empty[T])) { (elem, acc) => (elem, acc) match { - case (Value(value), Some(lst)) => Some(value :: lst) + case (Unlifted(value), Some(lst)) => Some(value :: lst) case (_, _) => None } } diff --git a/library/src/scala/quoted/Value.scala b/library/src/scala/quoted/Value.scala deleted file mode 100644 index 16f448f47fad..000000000000 --- a/library/src/scala/quoted/Value.scala +++ /dev/null @@ -1,18 +0,0 @@ -package scala.quoted - -/** Value expressions */ -object Value { - - /** Matches expressions containing values and extracts the value. - * - * Usage: - * ``` - * (x: Expr[B]) match { - * case Value(value) => ... // value: B - * } - * ``` - */ - def unapply[T](expr: Expr[T])(using unlift: Unliftable[T], qxtc: QuoteContext): Option[T] = - unlift(expr) - -} diff --git a/library/src/scala/quoted/autolift.scala b/library/src/scala/quoted/autolift.scala index 986cbf13c7a3..cfcf2e63569a 100644 --- a/library/src/scala/quoted/autolift.scala +++ b/library/src/scala/quoted/autolift.scala @@ -2,6 +2,8 @@ package scala.quoted /** Enable implicit conversion from a term of type `T` to an expression of type `Expr[T]` */ object autolift { + /** Implicit conversion from a term of type `T` to an expression of type `Expr[T]` */ - given autoToExpr[T](using Liftable[T], QuoteContext) as Conversion[T, Expr[T]] = Expr(_) + given autoToExpr[T](using Liftable[T], QuoteContext) as Conversion[T, Expr[T]] = Lifted(_) + } diff --git a/library/src/scala/quoted/matching/ValueSeq.scala b/library/src/scala/quoted/matching/ValueSeq.scala index 1c7095cda6c9..95e5424c7992 100644 --- a/library/src/scala/quoted/matching/ValueSeq.scala +++ b/library/src/scala/quoted/matching/ValueSeq.scala @@ -16,11 +16,11 @@ object ValueSeq { * } * ``` */ - @deprecated("use scala.quoted.Varargs(scala.quoted.Value(_)) instead", "0.23.0") + @deprecated("use scala.quoted.Varargs(scala.quoted.Unlift(_)) instead", "0.23.0") def unapply[T](expr: Expr[Seq[T]])(using unlift: Unliftable[T], qctx: QuoteContext): Option[Seq[T]] = import scala.quoted.Const expr match - case Varargs(Values(elems)) => Some(elems) + case Varargs(Unlifted(elems)) => Some(elems) case _ => None } diff --git a/library/src/scala/quoted/matching/package.scala b/library/src/scala/quoted/matching/package.scala index 807b32a028a6..42ff26b77707 100644 --- a/library/src/scala/quoted/matching/package.scala +++ b/library/src/scala/quoted/matching/package.scala @@ -23,10 +23,10 @@ package object matching { @deprecated("use scala.quoted.Lambda instead", "0.23.0") val Lambda: quoted.Lambda.type = quoted.Lambda - @deprecated("use scala.quoted.Value instead", "0.23.0") - val Value: quoted.Value.type = quoted.Value + @deprecated("use scala.quoted.Unlifted instead", "0.23.0") + val Value: quoted.Unlifted.type = quoted.Unlifted - @deprecated("use scala.quoted.Value instead", "0.23.0") - val ValueOfExpr: quoted.Value.type = quoted.Value + @deprecated("use scala.quoted.Unlifted instead", "0.23.0") + val ValueOfExpr: quoted.Unlifted.type = quoted.Unlifted } diff --git a/tests/neg-macros/GenericNumLits/Even_1.scala b/tests/neg-macros/GenericNumLits/Even_1.scala index fcb3288dd71e..7271f9168592 100644 --- a/tests/neg-macros/GenericNumLits/Even_1.scala +++ b/tests/neg-macros/GenericNumLits/Even_1.scala @@ -20,7 +20,7 @@ object Even { ctx.error(ex.getMessage) Even(0) } - '{Even(${Expr(ev.n)})} + '{Even(${Lifted(ev.n)})} case _ => '{evenFromDigits($digits)} } diff --git a/tests/neg-macros/inline-option/Macro_1.scala b/tests/neg-macros/inline-option/Macro_1.scala index 39cf1c5d3301..f7a8ac90ddec 100644 --- a/tests/neg-macros/inline-option/Macro_1.scala +++ b/tests/neg-macros/inline-option/Macro_1.scala @@ -3,7 +3,7 @@ import scala.quoted._ object Macro { def impl(opt: Expr[Option[Int]]) (using QuoteContext): Expr[Int] = opt.value match { - case Some(i) => Expr(i) + case Some(i) => Lifted(i) case None => '{-1} } } \ No newline at end of file diff --git a/tests/neg-macros/quote-macro-complex-arg-0.scala b/tests/neg-macros/quote-macro-complex-arg-0.scala index a1079aab4b39..f50c4252c8dd 100644 --- a/tests/neg-macros/quote-macro-complex-arg-0.scala +++ b/tests/neg-macros/quote-macro-complex-arg-0.scala @@ -2,5 +2,5 @@ import scala.quoted._ object Macros { inline def foo(inline i: Int, dummy: Int, j: Int): Int = ${ bar(i + 1, 'j) } // error: i + 1 is not a parameter or field reference - def bar(x: Int, y: Expr[Int])(using QuoteContext): Expr[Int] = '{ ${Expr(x)} + $y } + def bar(x: Int, y: Expr[Int])(using QuoteContext): Expr[Int] = '{ ${Lifted(x)} + $y } } diff --git a/tests/neg-macros/reflect-inline/assert_1.scala b/tests/neg-macros/reflect-inline/assert_1.scala index 5d5bb55cac08..89fd591ffa88 100644 --- a/tests/neg-macros/reflect-inline/assert_1.scala +++ b/tests/neg-macros/reflect-inline/assert_1.scala @@ -5,6 +5,6 @@ object api { ${ stripImpl('x) } private def stripImpl(x: Expr[String])(using qctx: QuoteContext): Expr[String] = - Expr(x.value.stripMargin) + Lifted(x.value.stripMargin) } diff --git a/tests/neg-with-compiler/GenericNumLits/Even_1.scala b/tests/neg-with-compiler/GenericNumLits/Even_1.scala index fcb3288dd71e..7271f9168592 100644 --- a/tests/neg-with-compiler/GenericNumLits/Even_1.scala +++ b/tests/neg-with-compiler/GenericNumLits/Even_1.scala @@ -20,7 +20,7 @@ object Even { ctx.error(ex.getMessage) Even(0) } - '{Even(${Expr(ev.n)})} + '{Even(${Lifted(ev.n)})} case _ => '{evenFromDigits($digits)} } diff --git a/tests/neg/BigFloat/BigFloat_1.scala b/tests/neg/BigFloat/BigFloat_1.scala index aae96aa5e3f9..aa6e685d8870 100644 --- a/tests/neg/BigFloat/BigFloat_1.scala +++ b/tests/neg/BigFloat/BigFloat_1.scala @@ -35,7 +35,7 @@ object BigFloat extends App { case Const(ds) => try { val BigFloat(m, e) = apply(ds) - '{BigFloat(${Expr(m)}, ${Expr(e)})} + '{BigFloat(${Lifted(m)}, ${Lifted(e)})} } catch { case ex: FromDigits.FromDigitsException => @@ -60,7 +60,7 @@ object BigFloat extends App { given Liftable[BigInt] { def toExpr(x: BigInt) = - '{BigInt(${Expr(x.toString)})} + '{BigInt(${Lifted(x.toString)})} } } diff --git a/tests/neg/i6762.scala b/tests/neg/i6762.scala index c653c454f06c..d3669a78263b 100644 --- a/tests/neg/i6762.scala +++ b/tests/neg/i6762.scala @@ -2,4 +2,4 @@ import scala.quoted.{_, given _} type G[X] case class Foo[T](x: T) -def f(word: String)(using QuoteContext): Expr[Foo[G[String]]] = '{Foo(${Expr(word)})} // error // error +def f(word: String)(using QuoteContext): Expr[Foo[G[String]]] = '{Foo(${Lifted(word)})} // error // error diff --git a/tests/neg/i7618.scala b/tests/neg/i7618.scala index c8122ea007c9..64aa589d07ad 100644 --- a/tests/neg/i7618.scala +++ b/tests/neg/i7618.scala @@ -14,7 +14,7 @@ object Compiler { inline def compile(e: Exp, env: Map[String, Expr[Int]])(using ctx: QuoteContext): Expr[Int] = inline e match { case Num(n) => - Expr(n) + Lifted(n) case Plus(e1, e2) => '{ ${ compile(e1, env) } + ${ compile(e2, env) } } case Var(x) => diff --git a/tests/neg/i7618b.scala b/tests/neg/i7618b.scala index 5467aa91d32c..a1a9c0b97c5b 100644 --- a/tests/neg/i7618b.scala +++ b/tests/neg/i7618b.scala @@ -14,7 +14,7 @@ object Compiler { inline def compile(e: Exp, env: Map[String, Expr[Int]])(using ctx: QuoteContext): Expr[Int] = inline e match { case Num(n) => - Expr(n) + Lifted(n) case Plus(e1, e2) => '{ ${ compile(e1, env) } + ${ compile(e2, env) } } case Var(x) => diff --git a/tests/pos-macros/quote-whitebox-2/Macro_1.scala b/tests/pos-macros/quote-whitebox-2/Macro_1.scala index a025b3089038..803aa7c89948 100644 --- a/tests/pos-macros/quote-whitebox-2/Macro_1.scala +++ b/tests/pos-macros/quote-whitebox-2/Macro_1.scala @@ -7,6 +7,6 @@ object Macro { def impl(strExpr: Expr[String]) (using QuoteContext)= val str = strExpr.value - if (str.length == 1) Expr(str.charAt(0)) else Expr(str) + if (str.length == 1) Lifted(str.charAt(0)) else Lifted(str) } diff --git a/tests/pos/i5547.scala b/tests/pos/i5547.scala index b6b167021a81..bc2f7b52945b 100644 --- a/tests/pos/i5547.scala +++ b/tests/pos/i5547.scala @@ -5,7 +5,7 @@ object scalatest { ${assertImpl('condition, '{""})} inline def assert2(condition: => Boolean): Unit = - ${ assertImpl('condition, Expr("")) } + ${ assertImpl('condition, Lifted("")) } def assertImpl(condition: Expr[Boolean], clue: Expr[Any])(using QuoteContext): Expr[Unit] = '{} diff --git a/tests/pos/i6214.scala b/tests/pos/i6214.scala index 3da36f7821b1..30ca189a2ef2 100644 --- a/tests/pos/i6214.scala +++ b/tests/pos/i6214.scala @@ -2,6 +2,6 @@ import scala.quoted._ object Test { def res(x: quoted.Expr[Int])(using QuoteContext): quoted.Expr[Int] = x match { case '{ val a: Int = $y; 1} => y // owner of `y` is `res` - case _ => '{ val b: Int = ${val c = 2; Expr(c)}; 1} // owner of `c` is `b`, but that seems to be OK + case _ => '{ val b: Int = ${val c = 2; Lifted(c)}; 1} // owner of `c` is `b`, but that seems to be OK } } \ No newline at end of file diff --git a/tests/pos/macro-docs.scala b/tests/pos/macro-docs.scala index bebe01cc3d66..fc2f7463b7c0 100644 --- a/tests/pos/macro-docs.scala +++ b/tests/pos/macro-docs.scala @@ -19,14 +19,14 @@ object MacrosMD_Liftable { given [T: Liftable : Type] as Liftable[List[T]] { def toExpr(xs: List[T]) = xs match { - case head :: tail => '{ ${ Expr(head) } :: ${ toExpr(tail) } } + case head :: tail => '{ ${ Lifted(head) } :: ${ toExpr(tail) } } case Nil => '{ Nil: List[T] } } } def showExpr[T](expr: Expr[T])(using QuoteContext): Expr[String] = { val code: String = expr.show - Expr(code) + Lifted(code) } } diff --git a/tests/pos/quote-lift.scala b/tests/pos/quote-lift.scala index 9e5b1adcedce..dbb95a7fd17b 100644 --- a/tests/pos/quote-lift.scala +++ b/tests/pos/quote-lift.scala @@ -9,7 +9,7 @@ class Test(using QuoteContext) { '{ ${summon[Liftable[Int]].toExpr(1)} } - '{ ${Expr(1)} } + '{ ${Lifted(1)} } } diff --git a/tests/pos/quote-liftable.scala b/tests/pos/quote-liftable.scala index eb71ffb5647e..fa0498eaa2d6 100644 --- a/tests/pos/quote-liftable.scala +++ b/tests/pos/quote-liftable.scala @@ -21,20 +21,20 @@ def test(using QuoteContext) = { implicit def ListIsLiftable[T: Liftable: Type]: Liftable[List[T]] = new { def toExpr(xs: List[T]) = xs match { - case x :: xs1 => '{ ${ Expr(x) } :: ${ toExpr(xs1) } } + case x :: xs1 => '{ ${ Lifted(x) } :: ${ toExpr(xs1) } } case Nil => '{Nil: List[T]} } } - Expr(true) - Expr(1) - Expr('a') - Expr(1) - Expr(1) - Expr(1L) - Expr(1.0f) - Expr(1.0) - Expr("abc") + Lifted(true) + Lifted(1) + Lifted('a') + Lifted(1) + Lifted(1) + Lifted(1L) + Lifted(1.0f) + Lifted(1.0) + Lifted("abc") - val xs: Expr[List[Int]] = Expr(1 :: 2 :: 3 :: Nil) + val xs: Expr[List[Int]] = Lifted(1 :: 2 :: 3 :: Nil) } diff --git a/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala b/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala index cb1d7e413bf6..0654f10b3a13 100644 --- a/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala +++ b/tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala @@ -5,7 +5,7 @@ inline def isFunctionType[T:Type]: Boolean = ${ isFunctionTypeImpl('[T]) } def isFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ - Expr(tp.unseal.tpe.isFunctionType) + Lifted(tp.unseal.tpe.isFunctionType) } @@ -13,7 +13,7 @@ inline def isContextFunctionType[T:Type]: Boolean = ${ isContextFunctionTypeImpl def isContextFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ - Expr(tp.unseal.tpe.isContextFunctionType) + Lifted(tp.unseal.tpe.isContextFunctionType) } @@ -21,13 +21,13 @@ inline def isErasedFunctionType[T:Type]: Boolean = ${ isErasedFunctionTypeImpl(' def isErasedFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ - Expr(tp.unseal.tpe.isErasedFunctionType) + Lifted(tp.unseal.tpe.isErasedFunctionType) } inline def isDependentFunctionType[T:Type]: Boolean = ${ isDependentFunctionTypeImpl('[T]) } def isDependentFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ - Expr(tp.unseal.tpe.isDependentFunctionType) + Lifted(tp.unseal.tpe.isDependentFunctionType) } diff --git a/tests/run-macros/BigFloat/BigFloat_1.scala b/tests/run-macros/BigFloat/BigFloat_1.scala index aae96aa5e3f9..aa6e685d8870 100644 --- a/tests/run-macros/BigFloat/BigFloat_1.scala +++ b/tests/run-macros/BigFloat/BigFloat_1.scala @@ -35,7 +35,7 @@ object BigFloat extends App { case Const(ds) => try { val BigFloat(m, e) = apply(ds) - '{BigFloat(${Expr(m)}, ${Expr(e)})} + '{BigFloat(${Lifted(m)}, ${Lifted(e)})} } catch { case ex: FromDigits.FromDigitsException => @@ -60,7 +60,7 @@ object BigFloat extends App { given Liftable[BigInt] { def toExpr(x: BigInt) = - '{BigInt(${Expr(x.toString)})} + '{BigInt(${Lifted(x.toString)})} } } diff --git a/tests/run-macros/expr-map-1/Macro_1.scala b/tests/run-macros/expr-map-1/Macro_1.scala index 3f5ab3b2d1d4..8cdbe18caf48 100644 --- a/tests/run-macros/expr-map-1/Macro_1.scala +++ b/tests/run-macros/expr-map-1/Macro_1.scala @@ -10,7 +10,7 @@ private object StringRewriter extends util.ExprMap { def transform[T](e: Expr[T])(using QuoteContext, Type[T]): Expr[T] = e match case Const(s: String) => - Expr(s.reverse) match + Lifted(s.reverse) match case '{ $x: T } => x case _ => e // e had a singlton String type case _ => transformChildren(e) diff --git a/tests/run-macros/flops-rewrite-2/Macro_1.scala b/tests/run-macros/flops-rewrite-2/Macro_1.scala index 2e398cdfb83c..a9cb39b04135 100644 --- a/tests/run-macros/flops-rewrite-2/Macro_1.scala +++ b/tests/run-macros/flops-rewrite-2/Macro_1.scala @@ -14,7 +14,7 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { case '{ plus($x, $y) } => (x, y) match { case (Const(0), _) => y - case (Const(a), Const(b)) => Expr(a + b) + case (Const(a), Const(b)) => Lifted(a + b) case (_, Const(_)) => '{ $y + $x } case _ => '{ $x + $y } } @@ -22,15 +22,15 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { (x, y) match { case (Const(0), _) => '{0} case (Const(1), _) => y - case (Const(a), Const(b)) => Expr(a * b) + case (Const(a), Const(b)) => Lifted(a * b) case (_, Const(_)) => '{ $y * $x } case _ => '{ $x * $y } } case '{ power(${Const(x)}, ${Const(y)}) } => - Expr(power(x, y)) + Lifted(power(x, y)) case '{ power($x, ${Const(y)}) } => if y == 0 then '{1} - else '{ times($x, power($x, ${Expr(y-1)})) } + else '{ times($x, power($x, ${Lifted(y-1)})) } }), fixPoint = true ) @@ -38,8 +38,8 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { val x2 = rewriter.transform(x) '{ - println(${Expr(x.show)}) - println(${Expr(x2.show)}) + println(${Lifted(x.show)}) + println(${Lifted(x2.show)}) println() $x2 } diff --git a/tests/run-macros/flops-rewrite-3/Macro_1.scala b/tests/run-macros/flops-rewrite-3/Macro_1.scala index dd6f196ec266..fb9462bcbdc6 100644 --- a/tests/run-macros/flops-rewrite-3/Macro_1.scala +++ b/tests/run-macros/flops-rewrite-3/Macro_1.scala @@ -13,7 +13,7 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { case '{ plus($x, $y) } => (x, y) match { case (Const(0), _) => y - case (Const(a), Const(b)) => Expr(a + b) + case (Const(a), Const(b)) => Lifted(a + b) case (_, Const(_)) => '{ $y + $x } case _ => '{ $x + $y } } @@ -21,23 +21,23 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { (x, y) match { case (Const(0), _) => '{0} case (Const(1), _) => y - case (Const(a), Const(b)) => Expr(a * b) + case (Const(a), Const(b)) => Lifted(a * b) case (_, Const(_)) => '{ $y * $x } case _ => '{ $x * $y } } case '{ power(${Const(x)}, ${Const(y)}) } => - Expr(power(x, y)) + Lifted(power(x, y)) case '{ power($x, ${Const(y)}) } => if y == 0 then '{1} - else '{ times($x, power($x, ${Expr(y-1)})) } + else '{ times($x, power($x, ${Lifted(y-1)})) } } ) val x2 = rewriter.transform(x) '{ - println(${Expr(x.show)}) - println(${Expr(x2.show)}) + println(${Lifted(x.show)}) + println(${Lifted(x2.show)}) println() $x2 } diff --git a/tests/run-macros/flops-rewrite/Macro_1.scala b/tests/run-macros/flops-rewrite/Macro_1.scala index 2722623dac26..ce9d45e26e12 100644 --- a/tests/run-macros/flops-rewrite/Macro_1.scala +++ b/tests/run-macros/flops-rewrite/Macro_1.scala @@ -16,8 +16,8 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { val x2 = rewriter.transform(x) '{ - println(${Expr(x.show)}) - println(${Expr(x2.show)}) + println(${Lifted(x.show)}) + println(${Lifted(x2.show)}) println() $x2 } diff --git a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala index 2982938d2fd9..c807f38652f6 100644 --- a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala +++ b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala @@ -8,21 +8,21 @@ object TypeToolbox { inline def =:=[A, B]: Boolean = ${tpEqImpl('[A], '[B])} private def tpEqImpl[A, B](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ - Expr(a.unseal.tpe =:= b.unseal.tpe) + Lifted(a.unseal.tpe =:= b.unseal.tpe) } /** is `tp1` a subtype of `tp2` */ inline def <:<[A, B]: Boolean = ${tpLEqImpl('[A], '[B])} private def tpLEqImpl[A, B](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ - Expr(a.unseal.tpe <:< b.unseal.tpe) + Lifted(a.unseal.tpe <:< b.unseal.tpe) } /** type associated with the tree */ inline def typeOf[T, Expected](a: T): Boolean = ${typeOfImpl('a, '[Expected])} private def typeOfImpl(a: Expr[_], expected: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ - Expr(a.unseal.tpe =:= expected.unseal.tpe) + Lifted(a.unseal.tpe =:= expected.unseal.tpe) } /** does the type refer to a case class? */ @@ -30,7 +30,7 @@ object TypeToolbox { private def isCaseClassImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ val sym = tp.unseal.symbol - Expr(sym.isClassDef && sym.flags.is(Flags.Case)) + Lifted(sym.isClassDef && sym.flags.is(Flags.Case)) } /** val fields of a case class Type -- only the ones declared in primary constructor */ @@ -38,59 +38,59 @@ object TypeToolbox { private def caseFieldsImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[List[String]] = { import qctx.tasty._ val fields = tp.unseal.symbol.caseFields.map(_.name) - Expr(fields) + Lifted(fields) } inline def fieldIn[T](inline mem: String): String = ${fieldInImpl('[T], 'mem)} private def fieldInImpl(t: Type[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ val field = t.unseal.symbol.field(mem.value) - Expr(if field.isNoSymbol then "" else field.name) + Lifted(if field.isNoSymbol then "" else field.name) } inline def fieldsIn[T]: Seq[String] = ${fieldsInImpl('[T])} private def fieldsInImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ val fields = t.unseal.symbol.fields - Expr(fields.map(_.name).toList) + Lifted(fields.map(_.name).toList) } inline def methodIn[T](inline mem: String): Seq[String] = ${methodInImpl('[T], 'mem)} private def methodInImpl(t: Type[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ - Expr(t.unseal.symbol.classMethod(mem.value).map(_.name)) + Lifted(t.unseal.symbol.classMethod(mem.value).map(_.name)) } inline def methodsIn[T]: Seq[String] = ${methodsInImpl('[T])} private def methodsInImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ - Expr(t.unseal.symbol.classMethods.map(_.name)) + Lifted(t.unseal.symbol.classMethods.map(_.name)) } inline def method[T](inline mem: String): Seq[String] = ${methodImpl('[T], 'mem)} private def methodImpl(t: Type[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ - Expr(t.unseal.symbol.method(mem.value).map(_.name)) + Lifted(t.unseal.symbol.method(mem.value).map(_.name)) } inline def methods[T]: Seq[String] = ${methodsImpl('[T])} private def methodsImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ - Expr(t.unseal.symbol.methods.map(_.name)) + Lifted(t.unseal.symbol.methods.map(_.name)) } inline def typeTag[T](x: T): String = ${typeTagImpl('[T])} private def typeTagImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ val res = tp.unseal.tpe.show - Expr(res) + Lifted(res) } inline def companion[T1, T2]: Boolean = ${companionImpl('[T1], '[T2])} private def companionImpl(t1: Type[_], t2: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ val res = t1.unseal.symbol.companionModule == t2.unseal.symbol - Expr(res) + Lifted(res) } inline def companionName[T1]: String = ${companionNameImpl('[T1])} @@ -101,7 +101,7 @@ object TypeToolbox { if sym.isClassDef then sym.companionModule.companionClass else if sym.isValDef then sym.companionClass else Symbol.noSymbol - Expr(if companionClass.isNoSymbol then "" else companionClass.fullName) + Lifted(if companionClass.isNoSymbol then "" else companionClass.fullName) } } diff --git a/tests/run-macros/i5629/Macro_1.scala b/tests/run-macros/i5629/Macro_1.scala index a4572ecf849e..e8419f2ff5b4 100644 --- a/tests/run-macros/i5629/Macro_1.scala +++ b/tests/run-macros/i5629/Macro_1.scala @@ -14,6 +14,6 @@ object Macros { def thisLineNumberImpl(using qctx: QuoteContext) : Expr[Int] = { import qctx.tasty._ - Expr(rootPosition.startLine) + Lifted(rootPosition.startLine) } } diff --git a/tests/run-macros/i6201/macro_1.scala b/tests/run-macros/i6201/macro_1.scala index cc05f8f7f9bc..212487454be6 100644 --- a/tests/run-macros/i6201/macro_1.scala +++ b/tests/run-macros/i6201/macro_1.scala @@ -4,10 +4,10 @@ inline def (inline x: String) strip: String = ${ stripImpl('x) } def stripImpl(x: Expr[String])(using qctx: QuoteContext) : Expr[String] = - Expr(x.value.stripMargin) + Lifted(x.value.stripMargin) inline def isHello(inline x: String): Boolean = ${ isHelloImpl('x) } def isHelloImpl(x: Expr[String])(using qctx: QuoteContext) : Expr[Boolean] = - if (x.value == "hello") Expr(true) else Expr(false) + if (x.value == "hello") Lifted(true) else Lifted(false) diff --git a/tests/run-macros/i6270/Macro_1.scala b/tests/run-macros/i6270/Macro_1.scala index 40372b74107c..7b46b259b613 100644 --- a/tests/run-macros/i6270/Macro_1.scala +++ b/tests/run-macros/i6270/Macro_1.scala @@ -7,7 +7,7 @@ object api { private def reflImpl(x: Expr[String])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ - Expr(x.show) + Lifted(x.show) } inline def (x: => String) reflectColor : String = @@ -15,6 +15,6 @@ object api { private def reflImplColor(x: Expr[String])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ - Expr(x.show(ANSI)) + Lifted(x.show(ANSI)) } } diff --git a/tests/run-macros/i6765-b/Macro_1.scala b/tests/run-macros/i6765-b/Macro_1.scala index 462f343b82da..d5cfc25369d0 100644 --- a/tests/run-macros/i6765-b/Macro_1.scala +++ b/tests/run-macros/i6765-b/Macro_1.scala @@ -5,5 +5,5 @@ inline def foo = ${fooImpl} def fooImpl(using qctx: QuoteContext) = { val res = Expr.ofList(List('{"One"})) - Expr(res.show) + Lifted(res.show) } diff --git a/tests/run-macros/i6765-c/Macro_1.scala b/tests/run-macros/i6765-c/Macro_1.scala index 477d2109a32a..2b056404d178 100644 --- a/tests/run-macros/i6765-c/Macro_1.scala +++ b/tests/run-macros/i6765-c/Macro_1.scala @@ -4,6 +4,6 @@ import scala.quoted.{given _} inline def foo(inline n: Int) = ${fooImpl('n)} def fooImpl(n: Expr[Int])(using qctx: QuoteContext) = { - val res = Expr.ofList(List.tabulate(n.value)(i => Expr("#" + i))) - '{ ${Expr(res.show)} + "\n" + $res.toString + "\n" } + val res = Expr.ofList(List.tabulate(n.value)(i => Lifted("#" + i))) + '{ ${Lifted(res.show)} + "\n" + $res.toString + "\n" } } diff --git a/tests/run-macros/i6765/Macro_1.scala b/tests/run-macros/i6765/Macro_1.scala index 08d24fb6add6..90b03f375695 100644 --- a/tests/run-macros/i6765/Macro_1.scala +++ b/tests/run-macros/i6765/Macro_1.scala @@ -6,5 +6,5 @@ inline def foo = ${fooImpl} def fooImpl(using qctx: QuoteContext) = { import qctx.tasty._ val res = Expr.ofList(List('{"One"})) - Expr(res.show) + Lifted(res.show) } diff --git a/tests/run-macros/i6803/Macro_1.scala b/tests/run-macros/i6803/Macro_1.scala index 288904bba029..4d590966c140 100644 --- a/tests/run-macros/i6803/Macro_1.scala +++ b/tests/run-macros/i6803/Macro_1.scala @@ -10,7 +10,7 @@ object AsObject { inline given LineNo = ${impl} private def impl(using qctx: QuoteContext): Expr[LineNo] = { import qctx.tasty.{given _, _} - '{unsafe(${Expr(rootPosition.startLine)})} + '{unsafe(${Lifted(rootPosition.startLine)})} } } } @@ -22,7 +22,7 @@ package AsPackage { inline given LineNo = ${impl} private def impl(using qctx: QuoteContext): Expr[LineNo] = { import qctx.tasty.{given _, _} - '{unsafe(${Expr(rootPosition.startLine)})} + '{unsafe(${Lifted(rootPosition.startLine)})} } } } diff --git a/tests/run-macros/i6988/FirstArg_1.scala b/tests/run-macros/i6988/FirstArg_1.scala index 2d837d4ca096..16f07f64e13a 100644 --- a/tests/run-macros/i6988/FirstArg_1.scala +++ b/tests/run-macros/i6988/FirstArg_1.scala @@ -27,6 +27,6 @@ object Macros { val paramss = enclosingParamList(rootContext.owner) val firstArg = paramss.flatten.head val ref = Select.unique(This(enclosingClass()), firstArg.name) - '{ FirstArg(${ref.seal}, ${Expr(firstArg.name)}) } + '{ FirstArg(${ref.seal}, ${Lifted(firstArg.name)}) } } } diff --git a/tests/run-macros/i7025/Macros_1.scala b/tests/run-macros/i7025/Macros_1.scala index 21ff73b7781f..6a45769782e5 100644 --- a/tests/run-macros/i7025/Macros_1.scala +++ b/tests/run-macros/i7025/Macros_1.scala @@ -13,7 +13,7 @@ object Macros { val x = nearestEnclosingDef(rootContext.owner) if x.isDefDef then val code = x.signature.toString - '{ println(${Expr(code)}) } + '{ println(${Lifted(code)}) } else '{()} } diff --git a/tests/run-macros/i7519c/Macro_1.scala b/tests/run-macros/i7519c/Macro_1.scala index 415500ef17c3..7022ca3b36fa 100644 --- a/tests/run-macros/i7519c/Macro_1.scala +++ b/tests/run-macros/i7519c/Macro_1.scala @@ -9,5 +9,5 @@ inline def quote[T]: String = ${ quoteImpl[T] } def quoteImpl[T: Type](using qctx: QuoteContext): Expr[String] = { val value: Expr[Int] = '{ 42 } - Expr(('{ new Quoted[T @Annot($value)] }).show) + Lifted(('{ new Quoted[T @Annot($value)] }).show) } diff --git a/tests/run-macros/i7898/Macro_1.scala b/tests/run-macros/i7898/Macro_1.scala index 5eabdb272f52..8208a2c31008 100644 --- a/tests/run-macros/i7898/Macro_1.scala +++ b/tests/run-macros/i7898/Macro_1.scala @@ -7,7 +7,7 @@ object Main { val bodyTerm = UnsafeExpr.underlyingArgument(body).unseal val showed = bodyTerm.show '{ - println(${Expr(showed)}) + println(${Lifted(showed)}) ${bodyTerm.seal} } } diff --git a/tests/run-macros/i7964/Macro_1.scala b/tests/run-macros/i7964/Macro_1.scala index b09eb08e28a2..9c3548ab8c86 100644 --- a/tests/run-macros/i7964/Macro_1.scala +++ b/tests/run-macros/i7964/Macro_1.scala @@ -12,7 +12,7 @@ private def fooExpr(numExpr: Expr[Num]) (using QuoteContext): Expr[Int] = case '{ Num.One } => Num.One case '{ Num.Two } => Num.Two } - Expr(toInt(num)) + Lifted(toInt(num)) private def toInt(num: Num): Int = num match { case Num.One => 1 diff --git a/tests/run-macros/i7987/Macros_1.scala b/tests/run-macros/i7987/Macros_1.scala index 955f1807d7ca..02af02908c18 100644 --- a/tests/run-macros/i7987/Macros_1.scala +++ b/tests/run-macros/i7987/Macros_1.scala @@ -7,6 +7,6 @@ object Macros { def macroImpl[T]()(using qctx: QuoteContext): Expr[String] = { Expr.summon[Mirror.Of[Some[Int]]] match - case Some('{ $_ : $t }) => Expr(t.show) + case Some('{ $_ : $t }) => Lifted(t.show) } } diff --git a/tests/run-macros/i8007/Macro_1.scala b/tests/run-macros/i8007/Macro_1.scala index 53cf0bed25b4..1fd9909e16b8 100644 --- a/tests/run-macros/i8007/Macro_1.scala +++ b/tests/run-macros/i8007/Macro_1.scala @@ -23,7 +23,7 @@ object Macro1 { Expr.summon(using mirrorTpe).get match { case '{ $m: Mirror.ProductOf[T]{ type MirroredElemLabels = $t } } => { - Expr(mirrorFields(t)) + Lifted(mirrorFields(t)) } } } diff --git a/tests/run-macros/i8007/Macro_2.scala b/tests/run-macros/i8007/Macro_2.scala index 586c0f86312a..6f3ad5a9e083 100644 --- a/tests/run-macros/i8007/Macro_2.scala +++ b/tests/run-macros/i8007/Macro_2.scala @@ -29,7 +29,7 @@ object Macro2 { } val body: Expr[T] => Expr[String] = elem => - fields.reverse.foldLeft(Expr("")){ (acc, field) => + fields.reverse.foldLeft(Lifted("")){ (acc, field) => val res = Select.unique(elem.unseal, field).seal '{ $res.toString + " " + $acc } } diff --git a/tests/run-macros/i8007/Macro_3.scala b/tests/run-macros/i8007/Macro_3.scala index da4353f3073a..5514e7a9640d 100644 --- a/tests/run-macros/i8007/Macro_3.scala +++ b/tests/run-macros/i8007/Macro_3.scala @@ -41,10 +41,10 @@ object Eq { case '{ $m: Mirror.ProductOf[T] { type MirroredElemTypes = $elementTypes }} => val elemInstances = summonAll(elementTypes) val eqProductBody: (Expr[T], Expr[T]) => Expr[Boolean] = (x, y) => { - elemInstances.zipWithIndex.foldLeft(Expr(true: Boolean)) { + elemInstances.zipWithIndex.foldLeft(Lifted(true: Boolean)) { case (acc, (elem, index)) => - val e1 = '{$x.asInstanceOf[Product].productElement(${Expr(index)})} - val e2 = '{$y.asInstanceOf[Product].productElement(${Expr(index)})} + val e1 = '{$x.asInstanceOf[Product].productElement(${Lifted(index)})} + val e2 = '{$y.asInstanceOf[Product].productElement(${Lifted(index)})} '{ $acc && $elem.asInstanceOf[Eq[Any]].eqv($e1, $e2) } } diff --git a/tests/run-macros/inline-case-objects/Macro_1.scala b/tests/run-macros/inline-case-objects/Macro_1.scala index 6c4f2e59a143..0dd4f812d97f 100644 --- a/tests/run-macros/inline-case-objects/Macro_1.scala +++ b/tests/run-macros/inline-case-objects/Macro_1.scala @@ -11,7 +11,7 @@ object Macros { case '{ foo.Bar } => foo.Bar case '{ foo.Bar.Baz } => foo.Bar.Baz } - Expr(obj.getClass.getCanonicalName) + Lifted(obj.getClass.getCanonicalName) } case object Bar { diff --git a/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala b/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala index 633fe47bdb28..ad8923402244 100644 --- a/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala +++ b/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala @@ -32,11 +32,11 @@ trait E[T] { } case class I(n: Int) extends E[Int] { - def lift (using QuoteContext): Expr[Int] = Expr(n) + def lift (using QuoteContext): Expr[Int] = Lifted(n) } case class D(n: Double) extends E[Double] { - def lift (using QuoteContext): Expr[Double] = Expr(n) + def lift (using QuoteContext): Expr[Double] = Lifted(n) } case class Plus[T](x: E[T], y: E[T])(implicit op: Plus2[T]) extends E[T] { diff --git a/tests/run-macros/lambda-extractor-1/Macro_1.scala b/tests/run-macros/lambda-extractor-1/Macro_1.scala index 0f720ec28db1..97b37e6d04af 100644 --- a/tests/run-macros/lambda-extractor-1/Macro_1.scala +++ b/tests/run-macros/lambda-extractor-1/Macro_1.scala @@ -4,7 +4,7 @@ import scala.quoted._ inline def test(inline f: Int => Int): String = ${ impl('f) } def impl(using QuoteContext)(f: Expr[Int => Int]): Expr[String] = { - Expr(f match { + Lifted(f match { case Lambda(body) => body('{1}).show case _ => f.show }) diff --git a/tests/run-macros/lambda-extractor-2/Macro_1.scala b/tests/run-macros/lambda-extractor-2/Macro_1.scala index dc789c45fa6d..0c5f80c7a732 100644 --- a/tests/run-macros/lambda-extractor-2/Macro_1.scala +++ b/tests/run-macros/lambda-extractor-2/Macro_1.scala @@ -4,7 +4,7 @@ import scala.quoted._ inline def test(inline f: (Int, Int) => Int): String = ${ impl('f) } def impl(using QuoteContext)(f: Expr[(Int, Int) => Int]): Expr[String] = { - Expr(f match { + Lifted(f match { case Lambda(body) => body('{1}, '{2}).show case _ => f.show }) diff --git a/tests/run-macros/quote-matcher-runtime/quoted_1.scala b/tests/run-macros/quote-matcher-runtime/quoted_1.scala index 314b12a97b6b..0e81e9f48d4c 100644 --- a/tests/run-macros/quote-matcher-runtime/quoted_1.scala +++ b/tests/run-macros/quote-matcher-runtime/quoted_1.scala @@ -19,9 +19,9 @@ object Macros { } '{ - println("Scrutinee: " + ${Expr(a.unseal.show)}) - println("Pattern: " + ${Expr(b.unseal.show)}) - println("Result: " + ${Expr(res.toString)}) + println("Scrutinee: " + ${Lifted(a.unseal.show)}) + println("Pattern: " + ${Lifted(b.unseal.show)}) + println("Result: " + ${Lifted(res.toString)}) println() } } diff --git a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala index 887f2c25605e..66a82f2fe716 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala @@ -11,7 +11,7 @@ object Macros { case ('{ StringContext(${Varargs(parts)}: _*) }, Varargs(args1)) => val strParts = parts.map { case Const(str) => str.reverse } val strArgs = args1.map { case Const(str) => str } - Expr(StringContext(strParts: _*).s(strArgs: _*)) + Lifted(StringContext(strParts: _*).s(strArgs: _*)) case _ => ??? } diff --git a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala index 079cdebc51ab..379bea8eacc8 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala @@ -10,7 +10,7 @@ object Macros { self match { case '{ StringContext(${Varargs(Consts(parts))}: _*) } => val upprerParts: List[String] = parts.toList.map(_.toUpperCase) - val upprerPartsExpr: Expr[List[String]] = Expr.ofList(upprerParts.map(Expr(_))) + val upprerPartsExpr: Expr[List[String]] = Expr.ofList(upprerParts.map(Lifted(_))) '{ StringContext($upprerPartsExpr: _*).s($args: _*) } case _ => '{ diff --git a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala index edf9809afcd3..862f5359afc3 100644 --- a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala @@ -11,7 +11,7 @@ object Macros { def lift(e: Expr[DSL]): Expr[T] = e match { case '{ LitDSL(${ Const(c) }) } => - '{ $sym.value(${Expr(c)}) } + '{ $sym.value(${Lifted(c)}) } case '{ ($x: DSL) + ($y: DSL) } => '{ $sym.plus(${lift(x)}, ${lift(y)}) } diff --git a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala index b58deac142a9..9dab44b02bd4 100644 --- a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala @@ -57,7 +57,7 @@ object Macros { def freshEnvVar()(using QuoteContext): (Int, Expr[DSL]) = { v += 1 - (v, '{envVar(${Expr(v)})}) + (v, '{envVar(${Lifted(v)})}) } var v = 0 def envVar(i: Int): DSL = ??? @@ -85,7 +85,7 @@ trait Symantics[Num] { } object StringNum extends Symantics[String] { - def value(x: Int)(using QuoteContext): Expr[String] = Expr(x.toString) + def value(x: Int)(using QuoteContext): Expr[String] = Lifted(x.toString) def plus(x: Expr[String], y: Expr[String])(using QuoteContext): Expr[String] = '{ s"${$x} + ${$y}" } // '{ x + " + " + y } def times(x: Expr[String], y: Expr[String])(using QuoteContext): Expr[String] = '{ s"${$x} * ${$y}" } def app(f: Expr[String => String], x: Expr[String])(using QuoteContext): Expr[String] = Expr.betaReduce(f)(x) @@ -93,7 +93,7 @@ object StringNum extends Symantics[String] { } object ComputeNum extends Symantics[Int] { - def value(x: Int)(using QuoteContext): Expr[Int] = Expr(x) + def value(x: Int)(using QuoteContext): Expr[Int] = Lifted(x) def plus(x: Expr[Int], y: Expr[Int])(using QuoteContext): Expr[Int] = '{ $x + $y } def times(x: Expr[Int], y: Expr[Int])(using QuoteContext): Expr[Int] = '{ $x * $y } def app(f: Expr[Int => Int], x: Expr[Int])(using QuoteContext): Expr[Int] = '{ $f($x) } @@ -101,7 +101,7 @@ object ComputeNum extends Symantics[Int] { } object ASTNum extends Symantics[ASTNum] { - def value(x: Int)(using QuoteContext): Expr[ASTNum] = '{ LitAST(${Expr(x)}) } + def value(x: Int)(using QuoteContext): Expr[ASTNum] = '{ LitAST(${Lifted(x)}) } def plus(x: Expr[ASTNum], y: Expr[ASTNum])(using QuoteContext): Expr[ASTNum] = '{ PlusAST($x, $y) } def times(x: Expr[ASTNum], y: Expr[ASTNum])(using QuoteContext): Expr[ASTNum] = '{ TimesAST($x, $y) } def app(f: Expr[ASTNum => ASTNum], x: Expr[ASTNum])(using QuoteContext): Expr[ASTNum] = '{ AppAST($f, $x) } diff --git a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala index acc7d5829d61..fb184cb16595 100644 --- a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala @@ -27,8 +27,8 @@ object Macros { } def lift[T: Type](e: Expr[T])(using env: Env): Expr[R[T]] = ((e: Expr[Any]) match { - case Const(e: Int) => '{ $sym.int(${Expr(e)}).asInstanceOf[R[T]] } - case Const(e: Boolean) => '{ $sym.bool(${Expr(e)}).asInstanceOf[R[T]] } + case Const(e: Int) => '{ $sym.int(${Lifted(e)}).asInstanceOf[R[T]] } + case Const(e: Boolean) => '{ $sym.bool(${Lifted(e)}).asInstanceOf[R[T]] } case '{ ($x: Int) + ($y: Int) } => '{ $sym.add(${lift(x)}, ${lift(y)}).asInstanceOf[R[T]] } @@ -78,7 +78,7 @@ object Macros { def freshEnvVar[T: Type]()(using QuoteContext): (Int, Expr[T]) = { v += 1 - (v, '{envVar[T](${Expr(v)})}) + (v, '{envVar[T](${Lifted(v)})}) } var v = 0 def envVar[T](i: Int): T = ??? diff --git a/tests/run-macros/quote-matching-open/Macro_1.scala b/tests/run-macros/quote-matching-open/Macro_1.scala index 755c92e3e634..c0166eb395e2 100644 --- a/tests/run-macros/quote-matching-open/Macro_1.scala +++ b/tests/run-macros/quote-matching-open/Macro_1.scala @@ -6,9 +6,9 @@ object Macro { def impl(x: Expr[Any])(using QuoteContext): Expr[Any] = { x match { - case '{ (x: Int) => ($body: Int => Int)(x) } => UnsafeExpr.open(body) { (body, close) => close(body)(Expr(2)) } - case '{ (x1: Int, x2: Int) => ($body: (Int, Int) => Int)(x1, x2) } => UnsafeExpr.open(body) { (body, close) => close(body)(Expr(2), Expr(3)) } - case '{ (x1: Int, x2: Int, x3: Int) => ($body: (Int, Int, Int) => Int)(x1, x2, x3) } => UnsafeExpr.open(body) { (body, close) => close(body)(Expr(2), Expr(3), Expr(4)) } + case '{ (x: Int) => ($body: Int => Int)(x) } => UnsafeExpr.open(body) { (body, close) => close(body)(Lifted(2)) } + case '{ (x1: Int, x2: Int) => ($body: (Int, Int) => Int)(x1, x2) } => UnsafeExpr.open(body) { (body, close) => close(body)(Lifted(2), Lifted(3)) } + case '{ (x1: Int, x2: Int, x3: Int) => ($body: (Int, Int, Int) => Int)(x1, x2, x3) } => UnsafeExpr.open(body) { (body, close) => close(body)(Lifted(2), Lifted(3), Lifted(4)) } } } diff --git a/tests/run-macros/quote-type-matcher-2/quoted_1.scala b/tests/run-macros/quote-type-matcher-2/quoted_1.scala index d11f5221e25a..7a7a6f326aba 100644 --- a/tests/run-macros/quote-type-matcher-2/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher-2/quoted_1.scala @@ -12,7 +12,7 @@ object Macros { case '[Function1[$t, $u]] => s"%${lift(t)} => ${lift(u)}%" case _ => tp.show } - Expr(lift(tp)) + Lifted(lift(tp)) } } diff --git a/tests/run-macros/quote-type-matcher/quoted_1.scala b/tests/run-macros/quote-type-matcher/quoted_1.scala index baa9749e14eb..2260a4880fe2 100644 --- a/tests/run-macros/quote-type-matcher/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher/quoted_1.scala @@ -17,9 +17,9 @@ object Macros { } '{ - println("Scrutinee: " + ${Expr(a.unseal.show)}) - println("Pattern: " + ${Expr(b.unseal.show)}) - println("Result: " + ${Expr(res.toString)}) + println("Scrutinee: " + ${Lifted(a.unseal.show)}) + println("Pattern: " + ${Lifted(b.unseal.show)}) + println("Result: " + ${Lifted(res.toString)}) println() } } diff --git a/tests/run-macros/quoted-matching-docs-2/Macro_1.scala b/tests/run-macros/quoted-matching-docs-2/Macro_1.scala index 412c74a547c5..ec3ba768e3e1 100644 --- a/tests/run-macros/quoted-matching-docs-2/Macro_1.scala +++ b/tests/run-macros/quoted-matching-docs-2/Macro_1.scala @@ -7,11 +7,11 @@ inline def showOptimize(arg: Int): String = ${ showOptimizeExpr('arg) } inline def optimize(arg: Int): Int = ${ optimizeExpr('arg) } private def showOptimizeExpr(body: Expr[Int])(using QuoteContext): Expr[String] = - Expr(optimizeExpr(body).show) + Lifted(optimizeExpr(body).show) private def optimizeExpr(body: Expr[Int])(using QuoteContext): Expr[Int] = body match { // Match a call to sum without any arguments - case '{ sum() } => Expr(0) + case '{ sum() } => Lifted(0) // Match a call to sum with an argument $n of type Int. n will be the Expr[Int] representing the argument. case '{ sum($n) } => n // Match a call to sum and extracts all its args in an `Expr[Seq[Int]]` @@ -33,5 +33,5 @@ private def sumExpr(args1: Seq[Expr[Int]])(using QuoteContext): Expr[Int] = { case Const(_) => false case arg => true } - dynamicSum.foldLeft(Expr(staticSum))((acc, arg) => '{ $acc + $arg }) + dynamicSum.foldLeft(Lifted(staticSum))((acc, arg) => '{ $acc + $arg }) } diff --git a/tests/run-macros/quoted-matching-docs/Macro_1.scala b/tests/run-macros/quoted-matching-docs/Macro_1.scala index 6aaade5c99bc..bafdfe38b49e 100644 --- a/tests/run-macros/quoted-matching-docs/Macro_1.scala +++ b/tests/run-macros/quoted-matching-docs/Macro_1.scala @@ -7,13 +7,13 @@ inline def sum(args: Int*): Int = ${ sumExpr('args) } inline def sumShow(args: Int*): String = ${ sumExprShow('args) } private def sumExprShow(argsExpr: Expr[Seq[Int]]) (using QuoteContext): Expr[String] = - Expr(sumExpr(argsExpr).show) + Lifted(sumExpr(argsExpr).show) private def sumExpr(argsExpr: Expr[Seq[Int]])(using qctx: QuoteContext) : Expr[Int] = { import qctx.tasty.{given _, _} UnsafeExpr.underlyingArgument(argsExpr) match { case Varargs(Consts(args)) => // args is of type Seq[Int] - Expr(args.sum) // precompute result of sum + Lifted(args.sum) // precompute result of sum case Varargs(argExprs) => // argExprs is of type Seq[Expr[Int]] val staticSum: Int = argExprs.map { case Const(arg) => arg @@ -23,7 +23,7 @@ private def sumExpr(argsExpr: Expr[Seq[Int]])(using qctx: QuoteContext) : Expr[I case Const(_) => false case arg => true } - dynamicSum.foldLeft(Expr(staticSum))((acc, arg) => '{ $acc + $arg }) + dynamicSum.foldLeft(Lifted(staticSum))((acc, arg) => '{ $acc + $arg }) case _ => '{ $argsExpr.sum } } diff --git a/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala b/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala index c6b05434c9a3..f216337e660e 100644 --- a/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala @@ -4,9 +4,9 @@ inline def test(e: Int): String = ${testExpr('e)} private def testExpr(e: Expr[Int])(using QuoteContext): Expr[String] = { e match { - case '{ val y: Int = 4; $body } => Expr("Matched closed\n" + body.show) - case '{ val y: Int = 4; ($body: Int => Int)(y) } => Expr("Matched open\n" + body.show) - case '{ val y: Int => Int = x => x + 1; ($body: (Int => Int) => Int)(y) } => Expr("Matched open\n" + body.show) - case '{ def g(x: Int): Int = ($body: (Int => Int, Int) => Int)(g, x); g(5) } => Expr("Matched open\n" + body.show) + case '{ val y: Int = 4; $body } => Lifted("Matched closed\n" + body.show) + case '{ val y: Int = 4; ($body: Int => Int)(y) } => Lifted("Matched open\n" + body.show) + case '{ val y: Int => Int = x => x + 1; ($body: (Int => Int) => Int)(y) } => Lifted("Matched open\n" + body.show) + case '{ def g(x: Int): Int = ($body: (Int => Int, Int) => Int)(g, x); g(5) } => Lifted("Matched open\n" + body.show) } } diff --git a/tests/run-macros/refined-selectable-macro/Macro_1.scala b/tests/run-macros/refined-selectable-macro/Macro_1.scala index 42454e9968b3..0135c9e4db78 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_1.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_1.scala @@ -34,7 +34,7 @@ object Macro { } def tupleElem(name: String, info: Type): Expr[Any] = { - val nameExpr = Expr(name) + val nameExpr = Lifted(name) info.seal match { case '[$qType] => Expr.ofTuple(Seq(nameExpr, '{ $s.selectDynamic($nameExpr).asInstanceOf[$qType] })) } diff --git a/tests/run-macros/reflect-inline/assert_1.scala b/tests/run-macros/reflect-inline/assert_1.scala index 99de4445f349..6f6470b7fd6c 100644 --- a/tests/run-macros/reflect-inline/assert_1.scala +++ b/tests/run-macros/reflect-inline/assert_1.scala @@ -5,12 +5,12 @@ object api { ${ stripImpl('x) } private def stripImpl(x: Expr[String])(using qctx: QuoteContext): Expr[String] = - Expr(augmentString(x.value).stripMargin) + Lifted(augmentString(x.value).stripMargin) inline def typeChecks(inline x: String): Boolean = ${ typeChecksImpl('{scala.compiletime.testing.typeChecks(x)}) } private def typeChecksImpl(b: Expr[Boolean])(using qctx: QuoteContext): Expr[Boolean] = { - if (b.value) Expr(true) else Expr(false) + if (b.value) Lifted(true) else Lifted(false) } } diff --git a/tests/run-macros/reflect-sourceCode/Macro_1.scala b/tests/run-macros/reflect-sourceCode/Macro_1.scala index 33bd0e98af57..47bda98ab456 100644 --- a/tests/run-macros/reflect-sourceCode/Macro_1.scala +++ b/tests/run-macros/reflect-sourceCode/Macro_1.scala @@ -6,6 +6,6 @@ object api { private def reflImpl[T](x: Expr[T])(implicit qctx: QuoteContext): Expr[String] = { import qctx.tasty._ - Expr(x.unseal.pos.sourceCode) + Lifted(x.unseal.pos.sourceCode) } } diff --git a/tests/run-macros/reflect-typeChecks/assert_1.scala b/tests/run-macros/reflect-typeChecks/assert_1.scala index 22a0d58e7570..700673eb53d1 100644 --- a/tests/run-macros/reflect-typeChecks/assert_1.scala +++ b/tests/run-macros/reflect-typeChecks/assert_1.scala @@ -6,6 +6,6 @@ object scalatest { inline def assertNotCompile(inline code: String): Unit = ${ assertImpl('code, '{compiletime.testing.typeChecks(code)}, false) } def assertImpl(code: Expr[String], actual: Expr[Boolean], expect: Boolean)(using qctx: QuoteContext) : Expr[Unit] = { - '{ assert(${Expr(expect)} == $actual) } + '{ assert(${Lifted(expect)} == $actual) } } } diff --git a/tests/run-macros/requiredSymbols/Macro_1.scala b/tests/run-macros/requiredSymbols/Macro_1.scala index c047e65f9376..7cc27e410612 100644 --- a/tests/run-macros/requiredSymbols/Macro_1.scala +++ b/tests/run-macros/requiredSymbols/Macro_1.scala @@ -22,6 +22,6 @@ object Macro { rootContext.requiredMethod("scala.List.empty"), ) - Expr(list.map(_.fullName).mkString("\n")) + Lifted(list.map(_.fullName).mkString("\n")) } } diff --git a/tests/run-macros/tasty-dealias/quoted_1.scala b/tests/run-macros/tasty-dealias/quoted_1.scala index a0c99aed1c7d..4f3e318451aa 100644 --- a/tests/run-macros/tasty-dealias/quoted_1.scala +++ b/tests/run-macros/tasty-dealias/quoted_1.scala @@ -6,6 +6,6 @@ object Macros { def impl[T](x: quoted.Type[T])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ - Expr(x.unseal.tpe.dealias.show) + Lifted(x.unseal.tpe.dealias.show) } } diff --git a/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala b/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala index f7ebec45890c..f65e866ab9c3 100644 --- a/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala @@ -12,7 +12,7 @@ object Macros { val buff = new StringBuilder def stagedPrintln(x: Any): Unit = buff append java.util.Objects.toString(x) append "\n" - Expr(3) match { case Const(n) => stagedPrintln(n) } + Lifted(3) match { case Const(n) => stagedPrintln(n) } '{4} match { case Const(n) => stagedPrintln(n) } '{"abc"} match { case Const(n) => stagedPrintln(n) } '{null} match { case Const(n) => stagedPrintln(n) } diff --git a/tests/run-macros/tasty-macro-positions/quoted_1.scala b/tests/run-macros/tasty-macro-positions/quoted_1.scala index bc94ec971729..c35fcaa782e1 100644 --- a/tests/run-macros/tasty-macro-positions/quoted_1.scala +++ b/tests/run-macros/tasty-macro-positions/quoted_1.scala @@ -14,7 +14,7 @@ object Macros { val code = x.unseal.underlyingArgument.show '{ println(${posStr(qctx)(pos)}) - println(${Expr(code)}) + println(${Lifted(code)}) } } @@ -24,13 +24,13 @@ object Macros { val code = x.unseal.show '{ println(${posStr(qctx)(pos)}) - println(${Expr(code)}) + println(${Lifted(code)}) } } def posStr(qctx: QuoteContext)(pos: qctx.tasty.Position): Expr[String] = { given QuoteContext = qctx import qctx.tasty._ - Expr(s"${pos.sourceFile.jpath.getFileName.toString}:[${pos.start}..${pos.end}]") + Lifted(s"${pos.sourceFile.jpath.getFileName.toString}:[${pos.start}..${pos.end}]") } } diff --git a/tests/run-macros/tasty-simplified/quoted_1.scala b/tests/run-macros/tasty-simplified/quoted_1.scala index c9ef9a10dd43..9eb4ae4b8d94 100644 --- a/tests/run-macros/tasty-simplified/quoted_1.scala +++ b/tests/run-macros/tasty-simplified/quoted_1.scala @@ -19,6 +19,6 @@ object Macros { } val tps = unpackTuple(typeOf[T]) - Varargs(tps.map(x => Expr(x.show))) + Varargs(tps.map(x => Lifted(x.show))) } } diff --git a/tests/run-macros/type-show/Macro_1.scala b/tests/run-macros/type-show/Macro_1.scala index 6f35fcbe6348..0102744356d3 100644 --- a/tests/run-macros/type-show/Macro_1.scala +++ b/tests/run-macros/type-show/Macro_1.scala @@ -4,6 +4,6 @@ object TypeToolbox { inline def show[A]: String = ${ showImpl('[A]) } private def showImpl[A, B](a: Type[A])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ - Expr(a.show) + Lifted(a.show) } } diff --git a/tests/run-staging/expr-matches.scala b/tests/run-staging/expr-matches.scala index 2f0255fbadfb..6afea9a8f64c 100644 --- a/tests/run-staging/expr-matches.scala +++ b/tests/run-staging/expr-matches.scala @@ -7,7 +7,7 @@ object Test { def main(args: Array[String]): Unit = withQuoteContext { assert('{1} matches '{1}) assert('{println("foo")} matches '{println("foo")}) - assert('{println("foo")} matches '{println(${Expr("foo")})}) + assert('{println("foo")} matches '{println(${Lifted("foo")})}) assert('{println(Some("foo"))} matches '{println(${ val a = '{Some("foo")}; a})}) } } diff --git a/tests/run-staging/i3847-b.scala b/tests/run-staging/i3847-b.scala index 43d75b08949f..50617a125ca4 100644 --- a/tests/run-staging/i3847-b.scala +++ b/tests/run-staging/i3847-b.scala @@ -6,7 +6,7 @@ object Arrays { implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T], qctx: QuoteContext): Liftable[Array[List[T]]] = { new Liftable[Array[List[T]]] { def toExpr(arr: Array[List[T]]) = '{ - new Array[List[$t]](${Expr(arr.length)}) + new Array[List[$t]](${Lifted(arr.length)}) // TODO add elements } } @@ -18,7 +18,7 @@ object Test { def main(args: Array[String]): Unit = withQuoteContext { import Arrays._ implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int} - val arr: Expr[Array[List[Int]]] = Expr(Array[List[Int]](List(1, 2, 3))) + val arr: Expr[Array[List[Int]]] = Lifted(Array[List[Int]](List(1, 2, 3))) println(arr.show) } } diff --git a/tests/run-staging/i3847.scala b/tests/run-staging/i3847.scala index 2fe1d02d6690..cbe7d794007d 100644 --- a/tests/run-staging/i3847.scala +++ b/tests/run-staging/i3847.scala @@ -6,7 +6,7 @@ object Arrays { implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T], ct: Expr[ClassTag[T]]): Liftable[Array[T]] = { new Liftable[Array[T]] { def toExpr(arr: Array[T]) = '{ - new Array[$t](${Expr(arr.length)})($ct) + new Array[$t](${Lifted(arr.length)})($ct) // TODO add elements } } @@ -18,7 +18,7 @@ object Test { def main(args: Array[String]): Unit = withQuoteContext { import Arrays._ implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int} - val arr: Expr[Array[Int]] = Expr(Array[Int](1, 2, 3)) + val arr: Expr[Array[Int]] = Lifted(Array[Int](1, 2, 3)) println(arr.show) } } diff --git a/tests/run-staging/i3947.scala b/tests/run-staging/i3947.scala index 4e65cdcfe2ae..9e665a742983 100644 --- a/tests/run-staging/i3947.scala +++ b/tests/run-staging/i3947.scala @@ -7,7 +7,7 @@ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947b.scala b/tests/run-staging/i3947b.scala index 68dcd0ea85da..43c3f49d75d4 100644 --- a/tests/run-staging/i3947b.scala +++ b/tests/run-staging/i3947b.scala @@ -8,7 +8,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println() println(name.show) diff --git a/tests/run-staging/i3947b2.scala b/tests/run-staging/i3947b2.scala index f2959802aec2..c0b36654ec51 100644 --- a/tests/run-staging/i3947b2.scala +++ b/tests/run-staging/i3947b2.scala @@ -8,7 +8,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: QuoteContext ?=> java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println() println(name.show) diff --git a/tests/run-staging/i3947b3.scala b/tests/run-staging/i3947b3.scala index 92a2e89e0628..629b83fc1cce 100644 --- a/tests/run-staging/i3947b3.scala +++ b/tests/run-staging/i3947b3.scala @@ -8,7 +8,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947c.scala b/tests/run-staging/i3947c.scala index f63890177c43..676fe2e89e77 100644 --- a/tests/run-staging/i3947c.scala +++ b/tests/run-staging/i3947c.scala @@ -7,7 +7,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947d.scala b/tests/run-staging/i3947d.scala index 3b44a5126b3f..f80a2d4e8615 100644 --- a/tests/run-staging/i3947d.scala +++ b/tests/run-staging/i3947d.scala @@ -6,7 +6,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947d2.scala b/tests/run-staging/i3947d2.scala index cc9e2a3839de..d8812948d065 100644 --- a/tests/run-staging/i3947d2.scala +++ b/tests/run-staging/i3947d2.scala @@ -7,7 +7,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947e.scala b/tests/run-staging/i3947e.scala index def71f6b51e9..2209738697d9 100644 --- a/tests/run-staging/i3947e.scala +++ b/tests/run-staging/i3947e.scala @@ -8,7 +8,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947f.scala b/tests/run-staging/i3947f.scala index 048d6d296404..af7a7e469c8b 100644 --- a/tests/run-staging/i3947f.scala +++ b/tests/run-staging/i3947f.scala @@ -8,7 +8,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947g.scala b/tests/run-staging/i3947g.scala index 89d1d32c5c9a..2c72a6509de3 100644 --- a/tests/run-staging/i3947g.scala +++ b/tests/run-staging/i3947g.scala @@ -6,7 +6,7 @@ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947i.scala b/tests/run-staging/i3947i.scala index 698b91b8b21b..6a36f6f5c7e2 100644 --- a/tests/run-staging/i3947i.scala +++ b/tests/run-staging/i3947i.scala @@ -7,7 +7,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i3947j.scala b/tests/run-staging/i3947j.scala index ea6dae78d9a3..4edaa36933bd 100644 --- a/tests/run-staging/i3947j.scala +++ b/tests/run-staging/i3947j.scala @@ -7,7 +7,7 @@ object Test { def main(args: Array[String]): Unit = run { def test[T: Type](clazz: java.lang.Class[T]) = { - val lclazz = Expr(clazz) + val lclazz = Lifted(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) '{ println($name) } diff --git a/tests/run-staging/i4730.scala b/tests/run-staging/i4730.scala index 148544af238a..1239c4fcb459 100644 --- a/tests/run-staging/i4730.scala +++ b/tests/run-staging/i4730.scala @@ -6,7 +6,7 @@ object Test { def ret(using QuoteContext): Expr[Int => Int] = '{ (x: Int) => ${ val z = run('{x + 1}) // throws a RunScopeException - Expr(z) + Lifted(z) } } def main(args: Array[String]): Unit = { diff --git a/tests/run-staging/i5161.scala b/tests/run-staging/i5161.scala index 9f2e6abaa4d4..246c79567d60 100644 --- a/tests/run-staging/i5161.scala +++ b/tests/run-staging/i5161.scala @@ -11,7 +11,7 @@ object Test { import Exp._ def evalTest(e: Exp)(using QuoteContext): Expr[Option[Int]] = e match { - case Int2(x) => '{ Some(${Expr(x)}) } + case Int2(x) => '{ Some(${Lifted(x)}) } case Add(e1, e2) => '{ (${evalTest(e1)}, ${evalTest(e2)}) match { diff --git a/tests/run-staging/i6992/Macro_1.scala b/tests/run-staging/i6992/Macro_1.scala index 72f98106e009..ab5e866c8625 100644 --- a/tests/run-staging/i6992/Macro_1.scala +++ b/tests/run-staging/i6992/Macro_1.scala @@ -14,7 +14,7 @@ object macros { import ctx.tasty._ try { body match { - case '{$x: Foo} => Expr(run(x).x) + case '{$x: Foo} => Lifted(run(x).x) } } catch { case ex: scala.quoted.ScopeException => diff --git a/tests/run-staging/i7381.scala b/tests/run-staging/i7381.scala index d9190e88e88c..bd60845df061 100644 --- a/tests/run-staging/i7381.scala +++ b/tests/run-staging/i7381.scala @@ -6,7 +6,7 @@ object Test { def main(args: Array[String]): Unit = { given Toolbox = Toolbox.make(getClass.getClassLoader) withQuoteContext { - val expr = Expr(List(1, 2, 3)) + val expr = Lifted(List(1, 2, 3)) println(expr.show) } } diff --git a/tests/run-staging/i8178.scala b/tests/run-staging/i8178.scala index 300a06c588fd..782bbae02a35 100644 --- a/tests/run-staging/i8178.scala +++ b/tests/run-staging/i8178.scala @@ -3,13 +3,13 @@ import scala.quoted.staging._ def foo(n: Int, t: Expr[Int])(using QuoteContext): Expr[Int] = if (n == 0) t - else '{ val a = ${Expr(n)}; ${foo(n - 1, 'a)} + $t } + else '{ val a = ${Lifted(n)}; ${foo(n - 1, 'a)} + $t } @main def Test = { // make available the necessary toolbox for runtime code generation given Toolbox = Toolbox.make(getClass.getClassLoader) - val f: Int = run { foo(2, Expr(5)) } + val f: Int = run { foo(2, Lifted(5)) } println(f) } diff --git a/tests/run-staging/quote-lib.scala b/tests/run-staging/quote-lib.scala index a70866824bd8..c191a63e5960 100644 --- a/tests/run-staging/quote-lib.scala +++ b/tests/run-staging/quote-lib.scala @@ -25,28 +25,28 @@ object Test { val t2: Expr[(Int, Int)] = (2, 3) val t3: Expr[(Int, Int, Int)] = (2, 3, 4) val t4: Expr[(Int, Int, Int, Int)] = (2, 3, 4, 5) - Expr((1, 2, 3, 4)) - Expr((1, 2, 3, 4, 5)) - Expr((1, 2, 3, 4, 5, 6)) - Expr((1, 2, 3, 4, 5, 6, 7)) - Expr((1, 2, 3, 4, 5, 6, 7, 8)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)) - Expr((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)) + Lifted((1, 2, 3, 4)) + Lifted((1, 2, 3, 4, 5)) + Lifted((1, 2, 3, 4, 5, 6)) + Lifted((1, 2, 3, 4, 5, 6, 7)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)) + Lifted((1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)) val list: List[Int] = List(1, 2, 3) val liftedList: Expr[List[Int]] = list @@ -70,30 +70,30 @@ object Test { val liftedIArray: Expr[IArray[Int]] = iarray val iarray2: IArray[String] = IArray("a", "b", "c") - Expr(iarray2) - - Expr(IArray(false)) - Expr(IArray(1: Byte)) - Expr(IArray(1: Short)) - Expr(IArray(1)) - Expr(IArray(1L)) - Expr(IArray(1.1f)) - Expr(IArray(1.1d)) - Expr(IArray('a')) - Expr(IArray((1, 3))) + Lifted(iarray2) + + Lifted(IArray(false)) + Lifted(IArray(1: Byte)) + Lifted(IArray(1: Short)) + Lifted(IArray(1)) + Lifted(IArray(1L)) + Lifted(IArray(1.1f)) + Lifted(IArray(1.1d)) + Lifted(IArray('a')) + Lifted(IArray((1, 3))) val array: Array[Int] = Array(1, 2, 3) val liftedArray: Expr[Array[Int]] = array - Expr(Array(false)) - Expr(Array(1: Byte)) - Expr(Array(1: Short)) - Expr(Array(1)) - Expr(Array(1L)) - Expr(Array(1.1f)) - Expr(Array(1.1d)) - Expr(Array('a')) - Expr(Array((1, 3))) + Lifted(Array(false)) + Lifted(Array(1: Byte)) + Lifted(Array(1: Short)) + Lifted(Array(1)) + Lifted(Array(1L)) + Lifted(Array(1.1f)) + Lifted(Array(1.1d)) + Lifted(Array('a')) + Lifted(Array((1, 3))) val some: Option[Int] = Some(2) val none: Option[Int] = Some(2) @@ -102,8 +102,8 @@ object Test { val left: Either[Int, Long] = Left(1) val right: Either[Int, Long] = Right(2L) - Expr(left) - Expr(right) + Lifted(left) + Lifted(right) println("quote lib ok") } diff --git a/tests/run-staging/quote-lift-BigDecimal.scala b/tests/run-staging/quote-lift-BigDecimal.scala index 7f94418535ec..9783bb6bab4a 100644 --- a/tests/run-staging/quote-lift-BigDecimal.scala +++ b/tests/run-staging/quote-lift-BigDecimal.scala @@ -3,8 +3,8 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = println(run { - val a = Expr(BigDecimal(2.3)) - val b = Expr(BigDecimal("1005849025843905834908593485984390583429058574925.95489543")) + val a = Lifted(BigDecimal(2.3)) + val b = Lifted(BigDecimal("1005849025843905834908593485984390583429058574925.95489543")) '{ ($a, $b) } }) } diff --git a/tests/run-staging/quote-lift-BigInt.scala b/tests/run-staging/quote-lift-BigInt.scala index cb35d779cd97..ff552f638c55 100644 --- a/tests/run-staging/quote-lift-BigInt.scala +++ b/tests/run-staging/quote-lift-BigInt.scala @@ -3,8 +3,8 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = println(run { - val a = Expr(BigInt(2)) - val b = Expr(BigInt("1005849025843905834908593485984390583429058574925")) + val a = Lifted(BigInt(2)) + val b = Lifted(BigInt("1005849025843905834908593485984390583429058574925")) '{ ($a, $b) } }) } diff --git a/tests/run-staging/quoted-show-name.scala b/tests/run-staging/quoted-show-name.scala index 57617e8d8fbe..6a0685b91776 100644 --- a/tests/run-staging/quoted-show-name.scala +++ b/tests/run-staging/quoted-show-name.scala @@ -15,7 +15,7 @@ object Test { def powerCode(n: Long, idx: Int, x: Expr[Double])(using QuoteContext): Expr[Double] = if (n == 0) '{1.0} else if (n == 1) x - else if (n % 2 == 0) '{ @showName(${Expr("x" + idx)}) val y = $x * $x; ${powerCode(n / 2, idx * 2, '{y})} } + else if (n % 2 == 0) '{ @showName(${Lifted("x" + idx)}) val y = $x * $x; ${powerCode(n / 2, idx * 2, '{y})} } else '{ $x * ${powerCode(n - 1, idx, x)} } } diff --git a/tests/run-staging/shonan-hmm-simple.scala b/tests/run-staging/shonan-hmm-simple.scala index c3a60fe0c313..10d87b52d6a8 100644 --- a/tests/run-staging/shonan-hmm-simple.scala +++ b/tests/run-staging/shonan-hmm-simple.scala @@ -126,8 +126,8 @@ object Test: def blasStaticIntExpr(using QuoteContext) = new Blas1(new RingIntExpr, new StaticVecOps) def resCode1(using QuoteContext) = blasStaticIntExpr.dot( - vec1.map(Expr(_)), - vec2.map(Expr(_)) + vec1.map(Lifted(_)), + vec2.map(Lifted(_)) ) println(withQuoteContext(resCode1.show)) println(run(resCode1)) diff --git a/tests/run-staging/shonan-hmm/Complex.scala b/tests/run-staging/shonan-hmm/Complex.scala index 85c3ee76762d..10fb81115975 100644 --- a/tests/run-staging/shonan-hmm/Complex.scala +++ b/tests/run-staging/shonan-hmm/Complex.scala @@ -5,7 +5,7 @@ case class Complex[T](re: T, im: T) object Complex { implicit def complexIsLiftable[T: Type: Liftable]: Liftable[Complex[T]] = new Liftable { - def toExpr(c: Complex[T]) = '{ Complex(${Expr(c.re)}, ${Expr(c.im)}) } + def toExpr(c: Complex[T]) = '{ Complex(${Lifted(c.re)}, ${Lifted(c.im)}) } } def of_complex_expr(x: Expr[Complex[Int]])(using QuoteContext): Complex[Expr[Int]] = Complex('{$x.re}, '{$x.im}) diff --git a/tests/run-staging/shonan-hmm/PV.scala b/tests/run-staging/shonan-hmm/PV.scala index ce7b092b7ed5..b09f06f36387 100644 --- a/tests/run-staging/shonan-hmm/PV.scala +++ b/tests/run-staging/shonan-hmm/PV.scala @@ -9,7 +9,7 @@ case class Dyn[T](x: Expr[T]) extends PV[T] object Dyns { def dyn[T: Liftable](pv: PV[T])(using QuoteContext): Expr[T] = pv match { - case Sta(x) => Expr(x) + case Sta(x) => Lifted(x) case Dyn(x) => x } def dyni(using QuoteContext): PV[Int] => Expr[Int] = dyn[Int] diff --git a/tests/run-staging/staged-tuples/StagedTuple.scala b/tests/run-staging/staged-tuples/StagedTuple.scala index 984f5dcf2d0b..119479a5252f 100644 --- a/tests/run-staging/staged-tuples/StagedTuple.scala +++ b/tests/run-staging/staged-tuples/StagedTuple.scala @@ -72,7 +72,7 @@ object StagedTuple { val res = if (!specialize) '{dynamicSize($tup)} else size match { - case Some(n) => Expr(n) + case Some(n) => Lifted(n) case None => '{dynamicSize($tup)} } res.as[Res] @@ -133,7 +133,7 @@ object StagedTuple { def fallbackApply(): Expr[Elem[Tup, N]] = nValue match { case Some(n) => qctx.error("index out of bounds: " + n, tup) - '{ throw new IndexOutOfBoundsException(${Expr(n.toString)}) } + '{ throw new IndexOutOfBoundsException(${Lifted(n.toString)}) } case None => '{dynamicApply($tup, $n)} } val res = size match { @@ -170,13 +170,13 @@ object StagedTuple { case Some(s) if s > 4 && s <= MaxSpecialized => val t = tup.as[Product] nValue match { - case Some(n) if n >= 0 && n < s => '{$t.productElement(${ Expr(n) })} + case Some(n) if n >= 0 && n < s => '{$t.productElement(${ Lifted(n) })} case _ => fallbackApply() } case Some(s) if s > MaxSpecialized => val t = tup.as[TupleXXL] nValue match { - case Some(n) if n >= 0 && n < s => '{$t.elems(${ Expr(n) })} + case Some(n) if n >= 0 && n < s => '{$t.elems(${ Lifted(n) })} case _ => fallbackApply() } case _ => fallbackApply()