diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 872a9714aa9a..36e122bf83ed 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -682,6 +682,14 @@ class Definitions { @tu lazy val QuotedExprModule_nullExpr: Symbol = QuotedExprModule.requiredMethod(nme.nullExpr) @tu lazy val QuotedExprModule_unitExpr: Symbol = QuotedExprModule.requiredMethod(nme.unitExpr) + @tu lazy val QuotedStagedClass: Symbol = requiredPackage("scala.quoted").typeRef.select("Staged".toTypeName).typeSymbol + + @tu lazy val QuotedTypeClass: ClassSymbol = requiredClass("scala.quoted.Type") + @tu lazy val QuotedType_splice: Symbol = QuotedTypeClass.requiredType(tpnme.spliceType) + + @tu lazy val QuotedTypeModule: Symbol = QuotedTypeClass.companionModule + @tu lazy val QuotedTypeModule_apply: Symbol = QuotedTypeModule.requiredMethod("apply") + @tu lazy val QuoteContextClass: ClassSymbol = requiredClass("scala.quoted.QuoteContext") @tu lazy val LiftableModule: Symbol = requiredModule("scala.quoted.Liftable") @@ -714,12 +722,6 @@ class Definitions { @tu lazy val InternalQuotedTypeModule: Symbol = requiredModule("scala.internal.quoted.Type") @tu lazy val InternalQuotedType_unapply: Symbol = InternalQuotedTypeModule.requiredMethod(nme.unapply) - @tu lazy val QuotedTypeClass: ClassSymbol = requiredClass("scala.quoted.Type") - @tu lazy val QuotedType_splice: Symbol = QuotedTypeClass.requiredType(tpnme.spliceType) - - @tu lazy val QuotedTypeModule: Symbol = QuotedTypeClass.companionModule - @tu lazy val QuotedTypeModule_apply: Symbol = QuotedTypeModule.requiredMethod("apply") - @tu lazy val TastyReflectionClass: ClassSymbol = requiredClass("scala.tasty.Reflection") @tu lazy val Unpickler_unpickleExpr: Symbol = requiredMethod("scala.internal.quoted.Unpickler.unpickleExpr") diff --git a/compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala b/compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala index 07d73a4cd03d..981e65390d75 100644 --- a/compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala +++ b/compiler/src/dotty/tools/dotc/core/quoted/PickledQuotes.scala @@ -44,7 +44,7 @@ object PickledQuotes { } /** Transform the expression into its fully spliced TypeTree */ - def quotedTypeToTree(tpe: quoted.Type[?])(using Context): Tree = { + def quotedTypeToTree(tpe: quoted.Type)(using Context): Tree = { val tpe1 = tpe.asInstanceOf[scala.internal.quoted.Type[Tree]] QuoteContext.checkScopeId(tpe1.scopeId) healOwner(tpe1.typeTree) @@ -91,7 +91,7 @@ object PickledQuotes { else // Replaces type holes generated by ReifyQuotes (non-spliced types). // These are types defined in a quote and used at the same level in a nested quote. - val quotedType = splices(idx).asInstanceOf[Seq[Any] => quoted.Type[?]](reifiedArgs) + val quotedType = splices(idx).asInstanceOf[Seq[Any] => quoted.Type](reifiedArgs) PickledQuotes.quotedTypeToTree(quotedType) case tree: Select => // Retain selected members @@ -134,7 +134,7 @@ object PickledQuotes { assert(tdef.symbol.hasAnnotation(defn.InternalQuoted_QuoteTypeTagAnnot)) val tree = tdef.rhs match case TypeBoundsTree(_, Hole(_, idx, args), _) => - val quotedType = splices(idx).asInstanceOf[Seq[Any] => quoted.Type[?]](args) + val quotedType = splices(idx).asInstanceOf[Seq[Any] => quoted.Type](args) PickledQuotes.quotedTypeToTree(quotedType) case TypeBoundsTree(_, tpt, _) => tpt diff --git a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala index f9499c6b4715..0ed4cd64190a 100644 --- a/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala +++ b/compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala @@ -222,7 +222,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages( * Emits and error if `T` cannot be healed and returns `T`. */ protected def tryHeal(sym: Symbol, tp: TypeRef, pos: SourcePosition)(using Context): TypeRef = { - val reqType = defn.QuotedTypeClass.typeRef.appliedTo(tp) + val reqType = defn.QuotedStagedClass.typeRef.appliedTo(tp) val tag = ctx.typer.inferImplicitArg(reqType, pos.span) tag.tpe match diff --git a/compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala b/compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala index 9bc1e4bcb5ea..855a75f53868 100644 --- a/compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala +++ b/compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala @@ -261,7 +261,7 @@ class ReifyQuotes extends MacroTransform { } assert(tpw.isInstanceOf[ValueType]) val argTpe = - if (tree.isType) defn.QuotedTypeClass.typeRef.appliedTo(tpw) + if (tree.isType) defn.QuotedStagedClass.typeRef.appliedTo(tpw) else defn.FunctionType(1, isContextual = true).appliedTo(defn.QuoteContextClass.typeRef, defn.QuotedExprClass.typeRef.appliedTo(tpw)) val selectArg = arg.select(nme.apply).appliedTo(Literal(Constant(i))).cast(argTpe) val capturedArg = SyntheticValDef(UniqueName.fresh(tree.symbol.name.toTermName).toTermName, selectArg) @@ -331,7 +331,9 @@ class ReifyQuotes extends MacroTransform { def getTypeHoleType(using Context) = new TypeMap() { override def apply(tp: Type): Type = tp match case tp: TypeRef if tp.typeSymbol.isTypeSplice => - apply(tp.dealias) + val dealiased = tp.dealias + if tp == dealiased then apply(tp.symbol.info.hiBound) + else apply(tp.dealias) case tp @ TypeRef(pre, _) if pre == NoPrefix || pre.termSymbol.isLocal => val hiBound = tp.typeSymbol.info match case info @ ClassInfo(_, _, classParents, _, _) => classParents.reduce(_ & _) diff --git a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala index 122d77056ece..109598eb973e 100644 --- a/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala +++ b/compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala @@ -167,7 +167,7 @@ trait QuotesAndSplices { case _ => TypeBounds.empty val typeSym = newSymbol(spliceOwner(ctx), name, EmptyFlags, typeSymInfo, NoSymbol, tree.expr.span) typeSym.addAnnotation(Annotation(New(ref(defn.InternalQuotedMatcher_patternTypeAnnot.typeRef)).withSpan(tree.expr.span))) - val pat = typedPattern(tree.expr, defn.QuotedTypeClass.typeRef.appliedTo(typeSym.typeRef))( + val pat = typedPattern(tree.expr, defn.QuotedStagedClass.typeRef.appliedTo(typeSym.typeRef))( using spliceContext.retractMode(Mode.QuotedPattern).withOwner(spliceOwner(ctx))) pat.select(tpnme.spliceType) else @@ -298,7 +298,7 @@ trait QuotesAndSplices { if (variance == -1) tdef.symbol.addAnnotation(Annotation(New(ref(defn.InternalQuotedMatcher_fromAboveAnnot.typeRef)).withSpan(tdef.span))) val bindingType = getBinding(tdef.symbol).symbol.typeRef - val bindingTypeTpe = AppliedType(defn.QuotedTypeClass.typeRef, bindingType :: Nil) + val bindingTypeTpe = AppliedType(defn.QuotedStagedClass.typeRef, bindingType :: Nil) val bindName = tdef.name.toString.stripPrefix("$").toTermName val sym = newPatternBoundSymbol(bindName, bindingTypeTpe, tdef.span, flags = ImplicitTerm)(using ctx0) buff += Bind(sym, untpd.Ident(nme.WILDCARD).withType(bindingTypeTpe)).withSpan(tdef.span) @@ -436,7 +436,7 @@ trait QuotesAndSplices { else typed(untpd.Tuple(splices.map(x => untpd.TypedSplice(replaceBindingsInTree.transform(x)))).withSpan(quoted.span), patType) val unapplySym = if (tree.quoted.isTerm) defn.InternalQuotedExpr_unapply else defn.InternalQuotedType_unapply - val quoteClass = if (tree.quoted.isTerm) defn.QuotedExprClass else defn.QuotedTypeClass + val quoteClass = if (tree.quoted.isTerm) defn.QuotedExprClass else defn.QuotedStagedClass val quotedPattern = if (tree.quoted.isTerm) ref(defn.InternalQuoted_exprQuote.termRef).appliedToType(defn.AnyType).appliedTo(shape).select(nme.apply).appliedTo(qctx) else ref(defn.QuotedTypeModule_apply.termRef).appliedToTypeTree(shape).select(nme.apply).appliedTo(qctx) diff --git a/library/src-bootstrapped/scala/quoted/Expr.scala b/library/src-bootstrapped/scala/quoted/Expr.scala index 14fc037169f5..f7a214656fac 100644 --- a/library/src-bootstrapped/scala/quoted/Expr.scala +++ b/library/src-bootstrapped/scala/quoted/Expr.scala @@ -41,7 +41,7 @@ abstract class Expr[+T] private[scala] { !scala.internal.quoted.Expr.unapply[EmptyTuple, EmptyTuple](this)(using that, false, qctx).isEmpty /** Checked cast to a `quoted.Expr[U]` */ - def cast[U](using tp: scala.quoted.Type[U])(using qctx: QuoteContext): scala.quoted.Expr[U] = { + def cast[U](using tp: scala.quoted.Staged[U])(using qctx: QuoteContext): scala.quoted.Expr[U] = { val tree = this.unseal val expectedType = tp.unseal.tpe if (tree.tpe <:< expectedType) @@ -118,7 +118,7 @@ object Expr { * `'{ Seq($e1, $e2, ...) }` typed as an `Expr[Seq[T]]` * ``` */ - def ofSeq[T](xs: Seq[Expr[T]])(using tp: Type[T], qctx: QuoteContext): Expr[Seq[T]] = Varargs(xs) + def ofSeq[T](xs: Seq[Expr[T]])(using tp: Staged[T], qctx: QuoteContext): Expr[Seq[T]] = Varargs(xs) /** Lifts this list of expressions into an expression of a list * @@ -127,7 +127,7 @@ object Expr { * to an expression equivalent to * `'{ List($e1, $e2, ...) }` typed as an `Expr[List[T]]` */ - def ofList[T](xs: Seq[Expr[T]])(using Type[T], QuoteContext): Expr[List[T]] = + def ofList[T](xs: Seq[Expr[T]])(using Staged[T], QuoteContext): Expr[List[T]] = if (xs.isEmpty) '{ Nil } else '{ List(${Varargs(xs)}: _*) } /** Lifts this sequence of expressions into an expression of a tuple @@ -191,7 +191,7 @@ object Expr { } /** Given a tuple of the form `(Expr[A1], ..., Expr[An])`, outputs a tuple `Expr[(A1, ..., An)]`. */ - def ofTuple[T <: Tuple: Tuple.IsMappedBy[Expr]: Type](tup: T)(using qctx: QuoteContext): Expr[Tuple.InverseMap[T, Expr]] = { + def ofTuple[T <: Tuple: Tuple.IsMappedBy[Expr]: Staged](tup: T)(using qctx: QuoteContext): Expr[Tuple.InverseMap[T, Expr]] = { val elems: Seq[Expr[Any]] = tup.asInstanceOf[Product].productIterator.toSeq.asInstanceOf[Seq[Expr[Any]]] ofTupleFromSeq(elems).cast[Tuple.InverseMap[T, Expr]] } @@ -204,7 +204,7 @@ object Expr { * @param tpe quoted type of the implicit parameter * @param qctx current context */ - def summon[T](using tpe: Type[T])(using qctx: QuoteContext): Option[Expr[T]] = { + def summon[T](using tpe: Staged[T])(using qctx: QuoteContext): Option[Expr[T]] = { import qctx.tasty._ searchImplicit(tpe.unseal.tpe) match { case iss: ImplicitSearchSuccess => Some(iss.tree.seal.asInstanceOf[Expr[T]]) diff --git a/library/src-bootstrapped/scala/quoted/Lambda.scala b/library/src-bootstrapped/scala/quoted/Lambda.scala index ccbdc70c9773..b3b0ec64f26e 100644 --- a/library/src-bootstrapped/scala/quoted/Lambda.scala +++ b/library/src-bootstrapped/scala/quoted/Lambda.scala @@ -15,7 +15,7 @@ object Lambda { * body('{3}) // returns '{ println(3) } * ``` */ - def unapply[F, Args <: Tuple, Res, G](expr: Expr[F])(using qctx: QuoteContext, tf: TupledFunction[F, Args => Res], tg: TupledFunction[G, Tuple.Map[Args, Expr] => Expr[Res]], functionType: Type[F]): Option[/*QuoteContext ?=>*/ G] = { + def unapply[F, Args <: Tuple, Res, G](expr: Expr[F])(using qctx: QuoteContext, tf: TupledFunction[F, Args => Res], tg: TupledFunction[G, Tuple.Map[Args, Expr] => Expr[Res]], functionType: Staged[F]): Option[/*QuoteContext ?=>*/ G] = { import qctx.tasty._ val argTypes = functionType.unseal.tpe match case AppliedType(_, functionArguments) => functionArguments.init.asInstanceOf[List[Type]] diff --git a/library/src-bootstrapped/scala/quoted/Liftable.scala b/library/src-bootstrapped/scala/quoted/Liftable.scala index 4f6fadf7b5a5..3068f13ff6e5 100644 --- a/library/src-bootstrapped/scala/quoted/Liftable.scala +++ b/library/src-bootstrapped/scala/quoted/Liftable.scala @@ -45,12 +45,12 @@ object Liftable { } } - given ClassTagIsLiftable[T: Type] as Liftable[ClassTag[T]] = new Liftable[ClassTag[T]] { + given ClassTagIsLiftable[T: Staged] 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]])}) } } - given ArrayIsLiftable[T: Type: Liftable: ClassTag] as Liftable[Array[T]] = new Liftable[Array[T]] { + given ArrayIsLiftable[T: Staged: 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]])}) } } @@ -103,192 +103,192 @@ object Liftable { else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } } - given iArrayIsLiftable[T: Type](using ltArray: Liftable[Array[T]]) as Liftable[IArray[T]] { + given iArrayIsLiftable[T: Staged](using ltArray: Liftable[Array[T]]) as Liftable[IArray[T]] { def toExpr(iarray: IArray[T]): QuoteContext ?=> Expr[IArray[T]] = '{ ${ltArray.toExpr(iarray.asInstanceOf[Array[T]])}.asInstanceOf[IArray[T]] } } - given [T: Type: Liftable] as Liftable[Seq[T]] = new Liftable[Seq[T]] { + given [T: Staged: Liftable] as Liftable[Seq[T]] = new Liftable[Seq[T]] { def toExpr(xs: Seq[T]): QuoteContext ?=> Expr[Seq[T]] = Expr.ofSeq(xs.map(summon[Liftable[T]].toExpr)) } - given [T: Type: Liftable] as Liftable[List[T]] = new Liftable[List[T]] { + given [T: Staged: Liftable] as Liftable[List[T]] = new Liftable[List[T]] { def toExpr(xs: List[T]): QuoteContext ?=> Expr[List[T]] = Expr.ofList(xs.map(summon[Liftable[T]].toExpr)) } - given [T: Type: Liftable] as Liftable[Set[T]] = new Liftable[Set[T]] { + given [T: Staged: Liftable] as Liftable[Set[T]] = new Liftable[Set[T]] { def toExpr(set: Set[T]): QuoteContext ?=> Expr[Set[T]] = '{ Set(${Expr(set.toSeq)}: _*) } } - given [T: Type: Liftable, U: Type: Liftable] as Liftable[Map[T, U]] = new Liftable[Map[T, U]] { + given [T: Staged: Liftable, U: Staged: 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)}: _*) } } - given [T: Type: Liftable] as Liftable[Option[T]] = new Liftable[Option[T]] { + given [T: Staged: 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 None => '{ None: Option[T] } } } - given [L: Type: Liftable, R: Type: Liftable] as Liftable[Either[L, R]] = new Liftable[Either[L, R]] { + given [L: Staged: Liftable, R: Staged: 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)}) } } } - given [T1: Type: Liftable] as Liftable[Tuple1[T1]] = new { + given [T1: Staged: Liftable] as Liftable[Tuple1[T1]] = new { def toExpr(tup: Tuple1[T1]) = '{ Tuple1(${Expr(tup._1)}) } } - given [T1: Type: Liftable, T2: Type: Liftable] as Liftable[Tuple2[T1, T2]] = new { + given [T1: Staged: Liftable, T2: Staged: Liftable] as Liftable[Tuple2[T1, T2]] = new { def toExpr(tup: Tuple2[T1, T2]) = '{ (${Expr(tup._1)}, ${Expr(tup._2)}) } } - given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable] as Liftable[Tuple3[T1, T2, T3]] = new { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable] as Liftable[Tuple3[T1, T2, T3]] = new { def toExpr(tup: Tuple3[T1, T2, T3]) = '{ (${Expr(tup._1)}, ${Expr(tup._2)}, ${Expr(tup._3)}) } } - given [T1: Type: Liftable, T2: Type: Liftable, T3: Type: Liftable, T4: Type: Liftable] as Liftable[Tuple4[T1, T2, T3, T4]] = new { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: 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)}) } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: Liftable, T16: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: Liftable, T16: Staged: Liftable, T17: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: Liftable, T16: Staged: Liftable, T17: Staged: Liftable, T18: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: Liftable, T16: Staged: Liftable, T17: Staged: Liftable, T18: Staged: Liftable, T19: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: Liftable, T16: Staged: Liftable, T17: Staged: Liftable, T18: Staged: Liftable, T19: Staged: Liftable, T20: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: Liftable, T16: Staged: Liftable, T17: Staged: Liftable, T18: Staged: Liftable, T19: Staged: Liftable, T20: Staged: Liftable, T21: Staged: 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)}) } } } - 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 { + given [T1: Staged: Liftable, T2: Staged: Liftable, T3: Staged: Liftable, T4: Staged: Liftable, T5: Staged: Liftable, T6: Staged: Liftable, T7: Staged: Liftable, T8: Staged: Liftable, T9: Staged: Liftable, T10: Staged: Liftable, T11: Staged: Liftable, T12: Staged: Liftable, T13: Staged: Liftable, T14: Staged: Liftable, T15: Staged: Liftable, T16: Staged: Liftable, T17: Staged: Liftable, T18: Staged: Liftable, T19: Staged: Liftable, T20: Staged: Liftable, T21: Staged: Liftable, T22: Staged: 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)}) } } } - given [H: Type: Liftable, T <: Tuple: Type: Liftable] as Liftable[H *: T] = new { + given [H: Staged: Liftable, T <: Tuple: Staged: 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 diff --git a/library/src-bootstrapped/scala/quoted/Type.scala b/library/src-bootstrapped/scala/quoted/Type.scala index 7f9dacba7adf..21545821a91c 100644 --- a/library/src-bootstrapped/scala/quoted/Type.scala +++ b/library/src-bootstrapped/scala/quoted/Type.scala @@ -3,9 +3,9 @@ package scala.quoted import scala.annotation.compileTimeOnly import scala.quoted.show.SyntaxHighlight -/** Quoted type (or kind) `T` */ -abstract class Type[X <: AnyKind] private[scala] { - type T = X +/** Staged type (or kind) `T` */ +abstract class Type private[scala] { + type T <: AnyKind /** Show a source code like representation of this type without syntax highlight */ def show(using qctx: QuoteContext): String = @@ -20,38 +20,41 @@ abstract class Type[X <: AnyKind] private[scala] { } +/** Staged type (or kind) `X` */ +type Staged[X <: AnyKind] = Type { type T = X } + /** Some basic type tags, currently incomplete */ object Type { /** Return a quoted.Type with the given type */ @compileTimeOnly("Reference to `scala.quoted.Type.apply` was not handled by ReifyQuotes") - given apply[T <: AnyKind] as (QuoteContext ?=> Type[T]) = ??? + given apply[T <: AnyKind] as (QuoteContext ?=> Staged[T]) = ??? - def UnitTag: QuoteContext ?=> Type[Unit] = - qctx.tasty.defn.UnitType.seal.asInstanceOf[quoted.Type[Unit]] + def UnitTag: QuoteContext ?=> Staged[Unit] = + qctx.tasty.defn.UnitType.seal.asInstanceOf[quoted.Staged[Unit]] - def BooleanTag: QuoteContext ?=> Type[Boolean] = - qctx.tasty.defn.BooleanType.seal.asInstanceOf[quoted.Type[Boolean]] + def BooleanTag: QuoteContext ?=> Staged[Boolean] = + qctx.tasty.defn.BooleanType.seal.asInstanceOf[quoted.Staged[Boolean]] - def ByteTag: QuoteContext ?=> Type[Byte] = - qctx.tasty.defn.ByteType.seal.asInstanceOf[quoted.Type[Byte]] + def ByteTag: QuoteContext ?=> Staged[Byte] = + qctx.tasty.defn.ByteType.seal.asInstanceOf[quoted.Staged[Byte]] - def CharTag: QuoteContext ?=> Type[Char] = - qctx.tasty.defn.CharType.seal.asInstanceOf[quoted.Type[Char]] + def CharTag: QuoteContext ?=> Staged[Char] = + qctx.tasty.defn.CharType.seal.asInstanceOf[quoted.Staged[Char]] - def ShortTag: QuoteContext ?=> Type[Short] = - qctx.tasty.defn.ShortType.seal.asInstanceOf[quoted.Type[Short]] + def ShortTag: QuoteContext ?=> Staged[Short] = + qctx.tasty.defn.ShortType.seal.asInstanceOf[quoted.Staged[Short]] - def IntTag: QuoteContext ?=> Type[Int] = - qctx.tasty.defn.IntType.seal.asInstanceOf[quoted.Type[Int]] + def IntTag: QuoteContext ?=> Staged[Int] = + qctx.tasty.defn.IntType.seal.asInstanceOf[quoted.Staged[Int]] - def LongTag: QuoteContext ?=> Type[Long] = - qctx.tasty.defn.LongType.seal.asInstanceOf[quoted.Type[Long]] + def LongTag: QuoteContext ?=> Staged[Long] = + qctx.tasty.defn.LongType.seal.asInstanceOf[quoted.Staged[Long]] - def FloatTag: QuoteContext ?=> Type[Float] = - qctx.tasty.defn.FloatType.seal.asInstanceOf[quoted.Type[Float]] + def FloatTag: QuoteContext ?=> Staged[Float] = + qctx.tasty.defn.FloatType.seal.asInstanceOf[quoted.Staged[Float]] - def DoubleTag: QuoteContext ?=> Type[Double] = - qctx.tasty.defn.DoubleType.seal.asInstanceOf[quoted.Type[Double]] + def DoubleTag: QuoteContext ?=> Staged[Double] = + qctx.tasty.defn.DoubleType.seal.asInstanceOf[quoted.Staged[Double]] } diff --git a/library/src-bootstrapped/scala/quoted/Unliftable.scala b/library/src-bootstrapped/scala/quoted/Unliftable.scala index c7d6d891f5ab..6f4eca65029a 100644 --- a/library/src-bootstrapped/scala/quoted/Unliftable.scala +++ b/library/src-bootstrapped/scala/quoted/Unliftable.scala @@ -30,7 +30,7 @@ object Unliftable { def apply(x: Expr[T])(using qctx: QuoteContext): Option[T] = Const.unapply(x) } - given Option_delegate[T](using Type[T], Unliftable[T]) as Unliftable[Option[T]] = new { + given Option_delegate[T](using Staged[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](${Unlifted(y)}) } => Some(Some(y)) @@ -50,7 +50,7 @@ object Unliftable { } - given Tuple1_delegate[T1](using Type[T1], Unliftable[T1]) as Unliftable[Tuple1[T1]] = new { + given Tuple1_delegate[T1](using Staged[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](${Unlifted(y)}) } => Some(Tuple1(y)) case '{ Tuple1[T1](${Unlifted(y)}) } => Some(Tuple1(y)) @@ -59,7 +59,7 @@ object Unliftable { override def toString(): String = "scala.quoted.Unliftable.Tuple1_delegate" } - given Tuple2_delegate[T1, T2](using Type[T1], Type[T2], Unliftable[T1], Unliftable[T2]) as Unliftable[Tuple2[T1, T2]] = new { + given Tuple2_delegate[T1, T2](using Staged[T1], Staged[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](${Unlifted(y1)}, ${Unlifted(y2)}) } => Some(Tuple2(y1, y2)) case '{ Tuple2[T1, T2](${Unlifted(y1)}, ${Unlifted(y2)}) } => Some(Tuple2(y1, y2)) @@ -69,7 +69,7 @@ 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 { + given Tuple3_delegate[T1, T2, T3](using Staged[T1], Staged[T2], Staged[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](${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)) @@ -79,7 +79,7 @@ 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 { + given Tuple4_delegate[T1, T2, T3, T4](using Staged[T1], Staged[T2], Staged[T3], Staged[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](${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)) @@ -89,7 +89,7 @@ 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 { + given Tuple5_delegate[T1, T2, T3, T4, T5](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[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](${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)) @@ -99,7 +99,7 @@ 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 { + given Tuple6_delegate[T1, T2, T3, T4, T5, T6](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[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](${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)) @@ -109,7 +109,7 @@ 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 { + given Tuple7_delegate[T1, T2, T3, T4, T5, T6, T7](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[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](${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)) @@ -119,7 +119,7 @@ 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 { + given Tuple8_delegate[T1, T2, T3, T4, T5, T6, T7, T8](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[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](${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)) @@ -129,7 +129,7 @@ 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 { + given Tuple9_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[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](${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)) @@ -139,7 +139,7 @@ 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 { + given Tuple10_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[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](${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)) @@ -149,7 +149,7 @@ 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 { + given Tuple11_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[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](${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)) @@ -159,7 +159,7 @@ 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 { + given Tuple12_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[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](${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)) @@ -169,7 +169,7 @@ 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 { + given Tuple13_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[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](${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)) @@ -179,7 +179,7 @@ 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 { + given Tuple14_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[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](${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)) @@ -189,7 +189,7 @@ 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 { + given Tuple15_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[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](${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)) @@ -199,7 +199,7 @@ 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 { + given Tuple16_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[T15], Staged[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](${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)) @@ -209,7 +209,7 @@ 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 { + given Tuple17_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[T15], Staged[T16], Staged[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](${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)) @@ -219,7 +219,7 @@ 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 { + given Tuple18_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[T15], Staged[T16], Staged[T17], Staged[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](${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)) @@ -229,7 +229,7 @@ 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 { + given Tuple19_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[T15], Staged[T16], Staged[T17], Staged[T18], Staged[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](${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)) @@ -239,7 +239,7 @@ 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 { + given Tuple20_delegate[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](using Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[T15], Staged[T16], Staged[T17], Staged[T18], Staged[T19], Staged[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](${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)) @@ -249,7 +249,7 @@ 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 { + 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 Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[T15], Staged[T16], Staged[T17], Staged[T18], Staged[T19], Staged[T20], Staged[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](${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)) @@ -259,7 +259,7 @@ 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 { + 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 Staged[T1], Staged[T2], Staged[T3], Staged[T4], Staged[T5], Staged[T6], Staged[T7], Staged[T8], Staged[T9], Staged[T10], Staged[T11], Staged[T12], Staged[T13], Staged[T14], Staged[T15], Staged[T16], Staged[T17], Staged[T18], Staged[T19], Staged[T20], Staged[T21], Staged[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](${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)) @@ -268,7 +268,7 @@ object Unliftable { override def toString(): String = "scala.quoted.Unliftable.Tuple22_delegate" } - given Seq_delegate[T](using Type[T], Unliftable[T]) as Unliftable[Seq[T]] = new { + given Seq_delegate[T](using Staged[T], Unliftable[T]) as Unliftable[Seq[T]] = new { def apply(x: Expr[Seq[T]])(using qctx: QuoteContext): Option[Seq[T]] = x match { case Varargs(Unlifted(elems)) => Some(elems) case '{ scala.collection.Seq[T](${Varargs(Unlifted(elems))}: _*) } => Some(elems) diff --git a/library/src-bootstrapped/scala/quoted/Varargs.scala b/library/src-bootstrapped/scala/quoted/Varargs.scala index c221f9393b94..e07ee6af8929 100644 --- a/library/src-bootstrapped/scala/quoted/Varargs.scala +++ b/library/src-bootstrapped/scala/quoted/Varargs.scala @@ -15,7 +15,7 @@ object Varargs { * '{ List(${Varargs(List(1, 2, 3))}: _*) } // equvalent to '{ List(1, 2, 3) } * ``` */ - def apply[T](xs: Seq[Expr[T]])(using tp: Type[T], qctx: QuoteContext): Expr[Seq[T]] = { + def apply[T](xs: Seq[Expr[T]])(using tp: Staged[T], qctx: QuoteContext): Expr[Seq[T]] = { import qctx.tasty._ Repeated(xs.map[Term](_.unseal).toList, tp.unseal).seal.asInstanceOf[Expr[Seq[T]]] } diff --git a/library/src-bootstrapped/scala/quoted/util/ExprMap.scala b/library/src-bootstrapped/scala/quoted/util/ExprMap.scala index aba68634bd35..5095f9445ede 100644 --- a/library/src-bootstrapped/scala/quoted/util/ExprMap.scala +++ b/library/src-bootstrapped/scala/quoted/util/ExprMap.scala @@ -5,10 +5,10 @@ import scala.quoted._ trait ExprMap { /** Map an expression `e` with a type `tpe` */ - def transform[T](e: Expr[T])(using qctx: QuoteContext, tpe: Type[T]): Expr[T] + def transform[T](e: Expr[T])(using qctx: QuoteContext, tpe: Staged[T]): Expr[T] /** Map subexpressions an expression `e` with a type `tpe` */ - def transformChildren[T](e: Expr[T])(using qctx: QuoteContext, tpe: Type[T]): Expr[T] = { + def transformChildren[T](e: Expr[T])(using qctx: QuoteContext, tpe: Staged[T]): Expr[T] = { import qctx.tasty._ final class MapChildren() { @@ -65,10 +65,8 @@ trait ExprMap { // TODO improve code case AppliedType(TypeRef(ThisType(TypeRef(NoPrefix(), "scala")), ""), List(tp0: Type)) => // TODO rewrite without using quotes - type T - val qtp: quoted.Type[T] = tp0.seal.asInstanceOf[quoted.Type[T]] - given qtp.type = qtp - '[Seq[T]].unseal.tpe + val t = tp0.seal.asInstanceOf[quoted.Type { type T <: Any }] + '[Seq[$t]].unseal.tpe case tp => tp Typed.copy(tree)(transformTerm(expr, tp), transformTypeTree(tpt)) case tree: NamedArg => @@ -114,7 +112,7 @@ trait ExprMap { case _ => type X val expr = tree.seal.asInstanceOf[Expr[X]] - val t = tpe.seal.asInstanceOf[quoted.Type[X]] + val t = tpe.seal.asInstanceOf[quoted.Staged[X]] transform(expr)(using qctx, t).unseal } } diff --git a/library/src-bootstrapped/scala/quoted/util/Var.scala b/library/src-bootstrapped/scala/quoted/util/Var.scala index de2325197182..9c103d2febbf 100644 --- a/library/src-bootstrapped/scala/quoted/util/Var.scala +++ b/library/src-bootstrapped/scala/quoted/util/Var.scala @@ -36,7 +36,7 @@ object Var { * } * ``` */ - def apply[T: Type, U: Type](init: Expr[T])(body: Var[T] => Expr[U])(using qctx: QuoteContext): Expr[U] = '{ + def apply[T: Staged, U: Staged](init: Expr[T])(body: Var[T] => Expr[U])(using qctx: QuoteContext): Expr[U] = '{ var x = $init ${ body( diff --git a/library/src-non-bootstrapped/scala/internal/quoted/CompileTime.scala b/library/src-non-bootstrapped/scala/internal/quoted/CompileTime.scala index 02c03da8d42a..79c36b323802 100644 --- a/library/src-non-bootstrapped/scala/internal/quoted/CompileTime.scala +++ b/library/src-non-bootstrapped/scala/internal/quoted/CompileTime.scala @@ -16,7 +16,7 @@ object CompileTime { def exprNestedSplice[T](ctx: QuoteContext)(x: ctx.Nested ?=> Expr[T]): T = ??? @compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.typeQuote`") - def typeQuote[T <: AnyKind]: Type[T] = ??? + def typeQuote[T <: AnyKind]: Staged[T] = ??? @compileTimeOnly("Illegal reference to `scala.internal.quoted.CompileTime.patternHole`") def patternHole[T]: T = ??? diff --git a/library/src-non-bootstrapped/scala/quoted/Type.scala b/library/src-non-bootstrapped/scala/quoted/Type.scala index 01f8e917fa06..1ff5f63f5560 100644 --- a/library/src-non-bootstrapped/scala/quoted/Type.scala +++ b/library/src-non-bootstrapped/scala/quoted/Type.scala @@ -1,5 +1,8 @@ package scala.quoted -abstract class Type[T <: AnyKind] private[scala]: - type `$splice` = T +abstract class Type private[scala]: + type `$splice` + type T def unseal(using qctx: QuoteContext): qctx.tasty.TypeTree + +type Staged[X <: AnyKind] = Type { type T = X } diff --git a/library/src/scala/internal/quoted/Type.scala b/library/src/scala/internal/quoted/Type.scala index b5949c9cae60..c242e06a5cf3 100644 --- a/library/src/scala/internal/quoted/Type.scala +++ b/library/src/scala/internal/quoted/Type.scala @@ -3,7 +3,7 @@ package scala.internal.quoted import scala.quoted._ /** Quoted type (or kind) `T` backed by a tree */ -final class Type[Tree](val typeTree: Tree, val scopeId: Int) extends scala.quoted.Type[Any] { +final class Type[Tree](val typeTree: Tree, val scopeId: Int) extends scala.quoted.Type { override def equals(that: Any): Boolean = that match { case that: Type[_] => typeTree == // TastyTreeExpr are wrappers around trees, therfore they are equals if their trees are equal. @@ -37,7 +37,7 @@ object Type { * @param qctx the current QuoteContext * @return None if it did not match, `Some(tup)` if it matched where `tup` contains `Type[Ti]`` */ - def unapply[TypeBindings <: Tuple, Tup <: Tuple](scrutineeType: scala.quoted.Type[_])(using patternType: scala.quoted.Type[_], + def unapply[TypeBindings <: Tuple, Tup <: Tuple](scrutineeType: scala.quoted.Type)(using patternType: scala.quoted.Type, hasTypeSplices: Boolean, qctx: QuoteContext): Option[Tup] = { new Matcher.QuoteMatcher[qctx.type].typeTreeMatch(scrutineeType.unseal, patternType.unseal, hasTypeSplices).asInstanceOf[Option[Tup]] } diff --git a/library/src/scala/internal/quoted/Unpickler.scala b/library/src/scala/internal/quoted/Unpickler.scala index 86fed70f4cf3..6afbe2ce4e00 100644 --- a/library/src/scala/internal/quoted/Unpickler.scala +++ b/library/src/scala/internal/quoted/Unpickler.scala @@ -1,6 +1,6 @@ package scala.internal.quoted -import scala.quoted.{Expr, QuoteContext, Type} +import scala.quoted.{Expr, QuoteContext, Staged, Type} /** Provides methods to unpickle `Expr` and `Type` trees. */ object Unpickler { @@ -19,9 +19,9 @@ object Unpickler { /** Unpickle `repr` which represents a pickled `Type` tree, * replacing splice nodes with `args` */ - def unpickleType[T](repr: PickledQuote, args: PickledArgs): QuoteContext ?=> Type[T] = + def unpickleType[T](repr: PickledQuote, args: PickledArgs): QuoteContext ?=> Staged[T] = val ctx = summon[QuoteContext] val tree = ctx.tasty.internal.unpickleType(repr, args) - new scala.internal.quoted.Type(tree, ctx.tasty.internal.compilerId).asInstanceOf[Type[T]] + new scala.internal.quoted.Type(tree, ctx.tasty.internal.compilerId).asInstanceOf[Staged[T]] } diff --git a/library/src/scala/tasty/Reflection.scala b/library/src/scala/tasty/Reflection.scala index edfee77e4aa2..41fb779fe712 100644 --- a/library/src/scala/tasty/Reflection.scala +++ b/library/src/scala/tasty/Reflection.scala @@ -1733,7 +1733,7 @@ class Reflection(private[scala] val internal: CompilerInterface) { self => /////////////// /** Returns the type (Type) of T */ - def typeOf[T](using qtype: scala.quoted.Type[T], ctx: Context): Type = + def typeOf[T](using qtype: scala.quoted.Staged[T], ctx: Context): Type = qtype.asInstanceOf[scala.internal.quoted.Type[T]].typeTree.asInstanceOf[TypeTree].tpe given TypeOrBoundsOps as AnyRef: @@ -1764,9 +1764,9 @@ class Reflection(private[scala] val internal: CompilerInterface) { self => extension (self: Type): - /** Convert `Type` to an `quoted.Type[_]` */ - def seal(using ctx: Context): scala.quoted.Type[_] = - new scala.internal.quoted.Type(Inferred(self), internal.compilerId) + /** Convert `Type` to an `quoted.Type` */ + def seal(using ctx: Context): scala.quoted.Type = + new scala.internal.quoted.Type(Inferred(self), internal.compilerId).asInstanceOf[scala.quoted.Type] /** Is `self` type the same as `that` type? * This is the case iff `self <:< that` and `that <:< self`. diff --git a/staging/test-resources/repl-staging/i6263 b/staging/test-resources/repl-staging/i6263 index 2dd3e41cc695..7027c03e9a91 100644 --- a/staging/test-resources/repl-staging/i6263 +++ b/staging/test-resources/repl-staging/i6263 @@ -2,8 +2,8 @@ scala> import quoted._ scala> import quoted.staging._ scala> implicit def toolbox: Toolbox = Toolbox.make(getClass.getClassLoader) def toolbox: quoted.staging.Toolbox -scala> def fn[T : Type](v : T) = println("ok") -def fn[T](v: T)(implicit evidence$1: quoted.Type[T]): Unit +scala> def fn[T : Staged](v : T) = println("ok") +def fn[T](v: T)(implicit evidence$1: scala.quoted.Staged[T]): Unit scala> withQuoteContext { fn("foo") } ok scala> withQuoteContext { fn((1,2)) } diff --git a/tests/neg-macros/i4493-b.scala b/tests/neg-macros/i4493-b.scala index 235f14c0a4a9..ee06b9c1d445 100644 --- a/tests/neg-macros/i4493-b.scala +++ b/tests/neg-macros/i4493-b.scala @@ -1,7 +1,7 @@ class Index[K] object Index { inline def succ[K](x: K): Unit = ${ - implicit val t: quoted.Type[K] = '[K] // error + implicit val t: quoted.Staged[K] = '[K] // error '{new Index[K]} } } diff --git a/tests/neg-macros/i4493.scala b/tests/neg-macros/i4493.scala index 852ac0d44d54..e7080efa5535 100644 --- a/tests/neg-macros/i4493.scala +++ b/tests/neg-macros/i4493.scala @@ -1,7 +1,7 @@ class Index[K] object Index { inline def succ[K]: Unit = ${ - implicit val t: quoted.Type[K] = '[K] // error + implicit val t: quoted.Staged[K] = '[K] // error '{new Index[K]} } } diff --git a/tests/neg-macros/i4774b.scala b/tests/neg-macros/i4774b.scala index efb4b591564e..5945effffd61 100644 --- a/tests/neg-macros/i4774b.scala +++ b/tests/neg-macros/i4774b.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Test { - def loop[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = '{ + def loop[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ val y: $t = $x; ${loop[$t]( // error 'y diff --git a/tests/neg-macros/i6530b.scala b/tests/neg-macros/i6530b.scala index 9a36fa93c3dc..4687b4b808d9 100644 --- a/tests/neg-macros/i6530b.scala +++ b/tests/neg-macros/i6530b.scala @@ -1,12 +1,12 @@ import scala.quoted._ object Foo { def program(using QuoteContext) = '{ - val tpe: quoted.Type[Int] = ??? + val tpe: quoted.Staged[Int] = ??? val expr: quoted.Expr[Int] = ??? val a: quoted.Expr[Int] = ${ '[Int] } // error val b: quoted.Expr[Int] = '{ $tpe } // error val c: ${ '{ 43 } } = ??? // error - val d: quoted.Type[Int] = '[ $expr ] // error + val d: quoted.Staged[Int] = '[ $expr ] // error } } diff --git a/tests/neg-macros/i6997.scala b/tests/neg-macros/i6997.scala deleted file mode 100644 index c90239ef986a..000000000000 --- a/tests/neg-macros/i6997.scala +++ /dev/null @@ -1,8 +0,0 @@ - -import scala.quoted._ -class Foo { - def mcrImpl(body: Expr[Any])(using t: Type[_ <: Any])(using ctx: QuoteContext): Expr[Any] = '{ - val tmp = ???.asInstanceOf[$t] // error // error - tmp - } -} diff --git a/tests/neg-macros/i7048e.scala b/tests/neg-macros/i7048e.scala index 1130b1bd601b..4d5d9031228d 100644 --- a/tests/neg-macros/i7048e.scala +++ b/tests/neg-macros/i7048e.scala @@ -3,9 +3,9 @@ import scala.quoted._ abstract class Test { type T - val T: Type[T] - val getT: Type[T] = T // need this to avoid getting `null` - given Type[T] = getT + val T: Staged[T] + val getT: Staged[T] = T // need this to avoid getting `null` + given Staged[T] = getT def foo(using QuoteContext): Expr[Any] = { @@ -14,7 +14,7 @@ abstract class Test { { val t: Test = this import t.{given _} - println(summon[Type[t.T]].show) + println(summon[Staged[t.T]].show) // val r = '{Option.empty[t.T]} // access to value t from wrong staging level val r2 = '{Option.empty[${t.T}]} // works } @@ -22,7 +22,7 @@ abstract class Test { { val r1 = '{Option.empty[${T}]} // works val r2 = '{Option.empty[List[${T}]]} // works - val r3 = '{summon[Type[${T}]]} // error: is not stable + val r3 = '{summon[Staged[${T}]]} // error: is not stable val r4 = '{summon[${T} <:< Any]} // error: is not stable } diff --git a/tests/neg-macros/i7121.scala b/tests/neg-macros/i7121.scala index 467fdd54be83..837173863342 100644 --- a/tests/neg-macros/i7121.scala +++ b/tests/neg-macros/i7121.scala @@ -1,7 +1,7 @@ import scala.quoted._ class annot1[T](x: Expr[T]) extends scala.annotation.Annotation -class annot2[T: Type](x: T) extends scala.annotation.Annotation +class annot2[T: Staged](x: T) extends scala.annotation.Annotation class Test()(implicit qtx: QuoteContext) { @annot1('{4}) // error diff --git a/tests/neg-macros/i7264d.scala b/tests/neg-macros/i7264d.scala index 010538b8ee77..fb498bac9e30 100644 --- a/tests/neg-macros/i7264d.scala +++ b/tests/neg-macros/i7264d.scala @@ -1,7 +1,7 @@ import scala.quoted._ class Foo { - def f[T2: Type](e: Expr[T2])(using QuoteContext) = e match { - case '{ $x: *:[Int, Any] } => // error: Type argument Any does not conform to upper bound Tuple + def f[T2: Staged](e: Expr[T2])(using QuoteContext) = e match { + case '{ $x: *:[Int, Any] } => // error: Staged argument Any does not conform to upper bound Tuple } } diff --git a/tests/neg-macros/i7323.scala b/tests/neg-macros/i7323.scala index 49d365ff8bc8..ddcfa3467fb1 100644 --- a/tests/neg-macros/i7323.scala +++ b/tests/neg-macros/i7323.scala @@ -1,3 +1,3 @@ trait Foo { type X } -def f[T](using scala.quoted.Type[T]) = ??? +def f[T](using scala.quoted.Staged[T]) = ??? def g(m: Foo) = f[m.X] // error \ No newline at end of file diff --git a/tests/neg-macros/i7603.scala b/tests/neg-macros/i7603.scala index dd543ebfdbcd..01ac03fdefb0 100644 --- a/tests/neg-macros/i7603.scala +++ b/tests/neg-macros/i7603.scala @@ -1,6 +1,6 @@ import scala.quoted._ class Foo { - def f[T2: Type](e: Expr[T2])(using QuoteContext) = e match { + def f[T2: Staged](e: Expr[T2])(using QuoteContext) = e match { case '{ $x: ${'[List[$t]]} } => // error case '{ $x: ${y @ '[List[$t]]} } => // error // error } diff --git a/tests/neg-macros/i7892.scala b/tests/neg-macros/i7892.scala index b738761a2a88..495c175aa41b 100644 --- a/tests/neg-macros/i7892.scala +++ b/tests/neg-macros/i7892.scala @@ -9,4 +9,4 @@ def run(using qctx: QuoteContext): Unit = { run1(cpsLeft) // error } -def run1[L:Type](cpsLeft: x.CExprResult1[L]): Unit = ??? +def run1[L: Staged](cpsLeft: x.CExprResult1[L]): Unit = ??? diff --git a/tests/neg-macros/i7919.scala b/tests/neg-macros/i7919.scala index dff211eb562d..c248c85f58dd 100644 --- a/tests/neg-macros/i7919.scala +++ b/tests/neg-macros/i7919.scala @@ -3,8 +3,9 @@ import scala.quoted._ object Test { def staged[T](using qctx: QuoteContext) = { import qctx.tasty._ - given typeT as quoted.Type[T] // error - val tTypeTree = typeT.unseal + given typeT as quoted.Staged[T] // error + val typeT2: quoted.Staged[Int] = ??? + val tTypeTree = typeT2.unseal val tt = typeOf[T] '{ "in staged" } } @@ -13,8 +14,12 @@ object Test { new Expr[Int] // error class Expr2 extends Expr[Int] // error - given Type[Int] // error - new Type[Int] // error - class Type2 extends Type[Int] // error + given Type // error + new Type // error + class Type2 extends Type // error + + given Staged[Int] // error + new Staged[Int] // error + class Type3 extends Staged[Int] // error } diff --git a/tests/neg-macros/i8052.scala b/tests/neg-macros/i8052.scala index acb40dd85f40..cecc6dcc1245 100644 --- a/tests/neg-macros/i8052.scala +++ b/tests/neg-macros/i8052.scala @@ -8,7 +8,7 @@ object Macro2 { } object TC { - def derived[T: Type](ev: Expr[Mirror.Of[T]])(using qctx: QuoteContext): Expr[TC[T]] = '{ + def derived[T: Staged](ev: Expr[Mirror.Of[T]])(using qctx: QuoteContext): Expr[TC[T]] = '{ new TC[T] { def encode(): Unit = $ev match { case '{ $m: Mirror.ProductOf[T] } => ??? // error diff --git a/tests/neg-macros/i8871.scala b/tests/neg-macros/i8871.scala deleted file mode 100644 index 4fa1bd3af936..000000000000 --- a/tests/neg-macros/i8871.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.quoted._ -object Macro { - def impl[A : Type](using qctx: QuoteContext): Unit = { - import qctx.tasty._ - val tpe = typeOf[A].seal.asInstanceOf[quoted.Type[_ <: AnyRef]] - '{ (a: ${tpe}) => ???} // error - } -} diff --git a/tests/neg-macros/i8871b.scala b/tests/neg-macros/i8871b.scala deleted file mode 100644 index bb363e90f29e..000000000000 --- a/tests/neg-macros/i8871b.scala +++ /dev/null @@ -1,9 +0,0 @@ -import scala.quoted._ -object Macro { - def impl[A : Type](using qctx: QuoteContext): Unit = { - import qctx.tasty._ - val tpe/*: quoted.Type[? <: AnyKind]*/ = typeOf[A].seal - '{ f[$tpe] } // error - } - def f[T <: AnyKind]: Unit = () -} diff --git a/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala b/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala index 299006f3112d..5abdcb8f510e 100644 --- a/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala +++ b/tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala @@ -6,9 +6,9 @@ object E { inline def eval[T](inline x: E[T]): T = ${ impl('x) } - def impl[T: Type](x: Expr[E[T]]) (using QuoteContext): Expr[T] = x.unliftOrError.lift + def impl[T: Staged](x: Expr[E[T]]) (using QuoteContext): Expr[T] = x.unliftOrError.lift - implicit def ev1[T: Type]: Unliftable[E[T]] = new Unliftable { + implicit def ev1[T: Staged]: Unliftable[E[T]] = new Unliftable { def apply(x: Expr[E[T]]) (using QuoteContext): Option[E[T]] = x match { case '{ I(${Const(n)}) } => Some(I(n).asInstanceOf[E[T]]) case '{ Plus[T](${Value(x)}, ${Value(y)})(using $op) } if op.matches('{Plus2.IPlus}) => Some(Plus(x, y)(using Plus2.IPlus.asInstanceOf[Plus2[T]]).asInstanceOf[E[T]]) diff --git a/tests/neg-macros/quote-1.scala b/tests/neg-macros/quote-1.scala index 0409266f1194..0b05acd201a8 100644 --- a/tests/neg-macros/quote-1.scala +++ b/tests/neg-macros/quote-1.scala @@ -2,11 +2,11 @@ import scala.quoted._ class Test { - def f[T](t: Type[T], x: Expr[T])(using QuoteContext) = '{ + def f[T](t: Staged[T], x: Expr[T])(using QuoteContext) = '{ val z2 = $x // error // error: wrong staging level } - def g[T](implicit t: Type[T], x: Expr[T], qctx: QuoteContext) = '{ + def g[T](implicit t: Staged[T], x: Expr[T], qctx: QuoteContext) = '{ val z2 = $x // ok } diff --git a/tests/neg-macros/quotedPatterns-5.scala b/tests/neg-macros/quotedPatterns-5.scala index abdb2edc5670..b56eb3ce7d4b 100644 --- a/tests/neg-macros/quotedPatterns-5.scala +++ b/tests/neg-macros/quotedPatterns-5.scala @@ -3,7 +3,7 @@ object Test { def test(x: quoted.Expr[Int])(using QuoteContext) = x match { case '{ type $t; poly[$t]($x); 4 } => ??? // error: duplicate pattern variable: $t case '{ type `$t`; poly[`$t`]($x); 4 } => - val tt: quoted.Type[_] = t // error + val tt: quoted.Staged[_] = t // error ??? case _ => } diff --git a/tests/neg-macros/quotedPatterns-6.scala b/tests/neg-macros/quotedPatterns-6.scala index 249763b0461d..cc6692028ec9 100644 --- a/tests/neg-macros/quotedPatterns-6.scala +++ b/tests/neg-macros/quotedPatterns-6.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Test { def test(x: quoted.Expr[Int])(using QuoteContext) = x match { case '{ poly[${Foo(t)}]($x); 4 } => ??? // error - case '{ type $t; poly[${Foo(y: quoted.Type[`$t`])}]($x); 4 } => ??? // error + case '{ type $t; poly[${Foo(y: quoted.Staged[`$t`])}]($x); 4 } => ??? // error case _ => } diff --git a/tests/neg-macros/type-splice-in-val-pattern.scala b/tests/neg-macros/type-splice-in-val-pattern.scala index ba4a3d1d04ba..a9dfcbced7d6 100644 --- a/tests/neg-macros/type-splice-in-val-pattern.scala +++ b/tests/neg-macros/type-splice-in-val-pattern.scala @@ -1,7 +1,7 @@ import scala.quoted._ object Foo { def f(using q: QuoteContext) = { - val t: Type[Int] = ??? + val t: Staged[Int] = ??? val '[ *:[$t] ] = ??? // error } } \ No newline at end of file diff --git a/tests/neg-staging/i5941/macro_1.scala b/tests/neg-staging/i5941/macro_1.scala index 856ecdb53db9..e2b2c1d36b84 100644 --- a/tests/neg-staging/i5941/macro_1.scala +++ b/tests/neg-staging/i5941/macro_1.scala @@ -11,7 +11,7 @@ object Lens { def set(t: T, s: S): S = _set(t)(s) } - def impl[S: Type, T: Type](getter: Expr[S => T])(using qctx: QuoteContext): Expr[Lens[S, T]] = { + def impl[S: Staged, T: Staged](getter: Expr[S => T])(using qctx: QuoteContext): Expr[Lens[S, T]] = { implicit val toolbox: scala.quoted.staging.Toolbox = scala.quoted.staging.Toolbox.make(this.getClass.getClassLoader) import qctx.tasty._ import util._ diff --git a/tests/pos-macros/i4023/Macro_1.scala b/tests/pos-macros/i4023/Macro_1.scala index 34551e3123fc..8beb5b46d99c 100644 --- a/tests/pos-macros/i4023/Macro_1.scala +++ b/tests/pos-macros/i4023/Macro_1.scala @@ -1,5 +1,5 @@ import scala.quoted._ object Macro { - inline def ff[T: Type](x: T): T = ${ impl('x) } + inline def ff[T: Staged](x: T): T = ${ impl('x) } def impl[T](x: Expr[T]): Expr[T] = x } diff --git a/tests/pos-macros/i4023b/Macro_1.scala b/tests/pos-macros/i4023b/Macro_1.scala index 3c4cf7774a54..76e141bf4030 100644 --- a/tests/pos-macros/i4023b/Macro_1.scala +++ b/tests/pos-macros/i4023b/Macro_1.scala @@ -1,5 +1,5 @@ import scala.quoted._ object Macro { - inline def ff[T](implicit t: Type[T]): Int = ${ impl[T] } + inline def ff[T](implicit t: Staged[T]): Int = ${ impl[T] } def impl[T](using QuoteContext): Expr[Int] = '{4} } diff --git a/tests/pos-macros/i4023c/Macro_1.scala b/tests/pos-macros/i4023c/Macro_1.scala index 33feeda9e5a8..f705375e1b69 100644 --- a/tests/pos-macros/i4023c/Macro_1.scala +++ b/tests/pos-macros/i4023c/Macro_1.scala @@ -1,5 +1,5 @@ import scala.quoted._ object Macro { inline def ff[T](x: T): T = ${ impl('x)('[T], summon[QuoteContext]) } - def impl[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = '{ $x: $t } + def impl[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ $x: $t } } diff --git a/tests/pos-macros/i4350.scala b/tests/pos-macros/i4350.scala index 0e3e1648e366..9f4775188604 100644 --- a/tests/pos-macros/i4350.scala +++ b/tests/pos-macros/i4350.scala @@ -1,5 +1,5 @@ import scala.quoted._ -class Foo[T: Type](using QuoteContext) { +class Foo[T: Staged](using QuoteContext) { '{null.asInstanceOf[T]} } diff --git a/tests/pos-macros/i4414.scala b/tests/pos-macros/i4414.scala index 0517942a555b..7fdd17fcb886 100644 --- a/tests/pos-macros/i4414.scala +++ b/tests/pos-macros/i4414.scala @@ -3,10 +3,10 @@ import scala.quoted._ object Test { given QuoteContext = ??? - def a[A: Type](): Unit = { + def a[A: Staged](): Unit = { b[Expr[A]]() a[A]() } - def b[A: Type](): Unit = ??? + def b[A: Staged](): Unit = ??? } diff --git a/tests/pos-macros/i4514.scala b/tests/pos-macros/i4514.scala index 904683b1e0f6..bb4a0fa9087f 100644 --- a/tests/pos-macros/i4514.scala +++ b/tests/pos-macros/i4514.scala @@ -1,5 +1,5 @@ import scala.quoted._ object Foo { inline def foo[X](x: X): Unit = ${fooImpl('x)} - def fooImpl[X: Type](x: X)(using QuoteContext): Expr[Unit] = '{} + def fooImpl[X: Staged](x: X)(using QuoteContext): Expr[Unit] = '{} } diff --git a/tests/pos-macros/i4539b.scala b/tests/pos-macros/i4539b.scala index d1eb6ce4fa4b..5551cccb850d 100644 --- a/tests/pos-macros/i4539b.scala +++ b/tests/pos-macros/i4539b.scala @@ -13,10 +13,10 @@ def test(using QuoteContext) = { '[String] } - def bar[T](t: quoted.Type[T]) = ??? + def bar[T](t: quoted.Staged[T]) = ??? bar('[String]) - class Baz[T](t: quoted.Type[T]) + class Baz[T](t: quoted.Staged[T]) new Baz('[String]) } diff --git a/tests/pos-macros/i4774a.scala b/tests/pos-macros/i4774a.scala index 4fa5e5aa0bc0..5acfdeb82437 100644 --- a/tests/pos-macros/i4774a.scala +++ b/tests/pos-macros/i4774a.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Test { - def loop[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = '{ + def loop[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ val y: $t = $x ${loop('y)} } diff --git a/tests/pos-macros/i4774c.scala b/tests/pos-macros/i4774c.scala index cbc2bf7be250..5bfc3cba1eb3 100644 --- a/tests/pos-macros/i4774c.scala +++ b/tests/pos-macros/i4774c.scala @@ -2,5 +2,5 @@ import scala.quoted._ object Test { - def loop[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = '{ val y = $x; ${loop('y)} } + def loop[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ val y = $x; ${loop('y)} } } diff --git a/tests/pos-macros/i4774d.scala b/tests/pos-macros/i4774d.scala index 54de29d9e6b7..553ef406aa67 100644 --- a/tests/pos-macros/i4774d.scala +++ b/tests/pos-macros/i4774d.scala @@ -2,6 +2,6 @@ import scala.quoted._ object Test { - def loop[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = + def loop[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ val y: T = $x; ${loop('y)} } } diff --git a/tests/pos-macros/i4774e.scala b/tests/pos-macros/i4774e.scala index 2910c77d3780..c5eff2f812ce 100644 --- a/tests/pos-macros/i4774e.scala +++ b/tests/pos-macros/i4774e.scala @@ -2,9 +2,9 @@ import scala.quoted._ object Test { - def loop[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = + def loop[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ def y = $x; ${ loop('y) } } - def loop2[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = + def loop2[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ def y() = $x; ${ loop('{y()}) } } } diff --git a/tests/pos-macros/i4774f.scala b/tests/pos-macros/i4774f.scala index d782bfac6ebf..02e1bec3177b 100644 --- a/tests/pos-macros/i4774f.scala +++ b/tests/pos-macros/i4774f.scala @@ -2,9 +2,9 @@ import scala.quoted._ object Test { - def loop[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = + def loop[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ def y: T = $x; ${ loop('y) } } - def loop2[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = + def loop2[T](x: Expr[T])(implicit t: Staged[T], qctx: QuoteContext): Expr[T] = '{ def y(): T = $x; ${ loop2('{y()}) } } } diff --git a/tests/pos-macros/i5954.scala b/tests/pos-macros/i5954.scala index 9cde97ca02cc..b1792928dbed 100644 --- a/tests/pos-macros/i5954.scala +++ b/tests/pos-macros/i5954.scala @@ -9,7 +9,7 @@ object MatcherFactory1 { '{ val a: Any = $self } - def impl2[T: Type](a: MatcherFactory1)(self: Expr[T])(implicit ev: T =:= a.AndNotWord, qctx: QuoteContext) = + def impl2[T: Staged](a: MatcherFactory1)(self: Expr[T])(implicit ev: T =:= a.AndNotWord, qctx: QuoteContext) = '{ val a: Any = $self } } diff --git a/tests/pos-macros/i5954b.scala b/tests/pos-macros/i5954b.scala index 8ebb4b28aaa4..85b9878067bb 100644 --- a/tests/pos-macros/i5954b.scala +++ b/tests/pos-macros/i5954b.scala @@ -9,7 +9,7 @@ object MatcherFactory1 { '{ val a: Any = $self } - def impl[T: Type](self: Expr[MatcherFactory1#AndNotWord[T]])(using QuoteContext) = + def impl[T: Staged](self: Expr[MatcherFactory1#AndNotWord[T]])(using QuoteContext) = '{ val a: Any = $self } } diff --git a/tests/pos-macros/i5954c.scala b/tests/pos-macros/i5954c.scala index 5b936144bdd7..d75b2ef4e21c 100644 --- a/tests/pos-macros/i5954c.scala +++ b/tests/pos-macros/i5954c.scala @@ -9,7 +9,7 @@ object MatcherFactory1 { '{ val a: Any = $self } - def impl[T: Type](self: Expr[MatcherFactory1[T]#AndNotWord])(using QuoteContext) = + def impl[T: Staged](self: Expr[MatcherFactory1[T]#AndNotWord])(using QuoteContext) = '{ val a: Any = $self } } diff --git a/tests/pos-macros/i5954d.scala b/tests/pos-macros/i5954d.scala index 1ffde4481d41..1d3a9862fe71 100644 --- a/tests/pos-macros/i5954d.scala +++ b/tests/pos-macros/i5954d.scala @@ -9,7 +9,7 @@ object MatcherFactory1 { '{ val a: Any = $self } - def impl2[T: Type](a: MatcherFactory1)(self: Expr[T])(implicit ev: T =:= a.AndNotWord, qctx: QuoteContext) = + def impl2[T: Staged](a: MatcherFactory1)(self: Expr[T])(implicit ev: T =:= a.AndNotWord, qctx: QuoteContext) = '{ val a: Any = $self } } diff --git a/tests/pos-macros/i5962.scala b/tests/pos-macros/i5962.scala index da9a5ccc1c67..59dc1c010fc3 100644 --- a/tests/pos-macros/i5962.scala +++ b/tests/pos-macros/i5962.scala @@ -6,7 +6,7 @@ class MatchFactory1[T, S[_]] { object MatcherFactory1 { - def impl[T: Type, S[_], M >: MatchFactory1[T, S] <: MatchFactory1[T, S] : Type](self: Expr[M])(implicit qctx: QuoteContext, tpS: Type[S[T]]) = + def impl[T: Staged, S[_], M >: MatchFactory1[T, S] <: MatchFactory1[T, S] : Staged](self: Expr[M])(implicit qctx: QuoteContext, tpS: Staged[S[T]]) = '{ val a = ${self}; a.f } } diff --git a/tests/pos-macros/i6140.scala b/tests/pos-macros/i6140.scala index 96247819bc1f..987ec4c2a2a6 100644 --- a/tests/pos-macros/i6140.scala +++ b/tests/pos-macros/i6140.scala @@ -4,5 +4,5 @@ sealed trait Trait[T] { } object O { - def fn[T:Type](t : Trait[T])(using QuoteContext): Type[T] = '[t.t] + def fn[T: Staged](t : Trait[T])(using QuoteContext): Staged[T] = '[t.t] } diff --git a/tests/pos-macros/i6142.scala b/tests/pos-macros/i6142.scala index fc726dd4b025..7c0afd40a96d 100644 --- a/tests/pos-macros/i6142.scala +++ b/tests/pos-macros/i6142.scala @@ -3,7 +3,7 @@ import scala.quoted._ object O { def foo(using QuoteContext) = { type T - implicit val _: scala.quoted.Type[T] = ??? + implicit val _: scala.quoted.Staged[T] = ??? '[List[T]] () } diff --git a/tests/pos-macros/i6210/Macros_1.scala b/tests/pos-macros/i6210/Macros_1.scala index 24c4fb839c7b..3a45dabca076 100644 --- a/tests/pos-macros/i6210/Macros_1.scala +++ b/tests/pos-macros/i6210/Macros_1.scala @@ -4,7 +4,7 @@ object Macro { inline def test[A, B]: Any = ${ impl[A, B] } - def impl[A : Type, B : Type](using QuoteContext): Expr[Any] = { + def impl[A : Staged, B : Staged](using QuoteContext): Expr[Any] = { val t = '[Map[A, B]] '{ new Object().asInstanceOf[$t] diff --git a/tests/pos-macros/i6588.scala b/tests/pos-macros/i6588.scala index d323360d2909..00eb99957e65 100644 --- a/tests/pos-macros/i6588.scala +++ b/tests/pos-macros/i6588.scala @@ -1,6 +1,6 @@ import scala.quoted._ -inline def foo[T:Type]: Int = 10 +inline def foo[T: Staged]: Int = 10 def main(using QuoteContext) = { type S = Int diff --git a/tests/pos-macros/i6693.scala b/tests/pos-macros/i6693.scala new file mode 100644 index 000000000000..28852a10ebe6 --- /dev/null +++ b/tests/pos-macros/i6693.scala @@ -0,0 +1,16 @@ +package towers.computes + +import quoted._ + +sealed abstract class Computes[T] + +object Computes { + + opaque type Opaque[T] = Int + + implicit class ComputesApplication1[T : Staged](fn : Computes[Opaque[T]]) { + def apply[A](arg1 : Computes[A]) : Computes[T] = ??? + } + + def let[V, T : Staged](value : Computes[V], body : Computes[Opaque[T]]) : Computes[T] = body(value) +} diff --git a/tests/pos-macros/i6997.scala b/tests/pos-macros/i6997.scala new file mode 100644 index 000000000000..100fc6bf2645 --- /dev/null +++ b/tests/pos-macros/i6997.scala @@ -0,0 +1,8 @@ + +import scala.quoted._ +class Foo { + def mcrImpl(body: Expr[Any])(using t: Staged[_ <: Any])(using ctx: QuoteContext): Expr[Any] = '{ + val tmp = ???.asInstanceOf[$t] + tmp + } +} diff --git a/tests/pos-macros/i7048.scala b/tests/pos-macros/i7048.scala index fba9ed619821..f31a1df21738 100644 --- a/tests/pos-macros/i7048.scala +++ b/tests/pos-macros/i7048.scala @@ -7,7 +7,7 @@ trait IsExpr[T] { def f(x: Any): String = x.toString -def g[T](using e: IsExpr[T], tu: Type[e.Underlying]): QuoteContext ?=> Expr[String] = { +def g[T](using e: IsExpr[T], tu: Staged[e.Underlying]): QuoteContext ?=> Expr[String] = { val underlying: Expr[e.Underlying] = e.expr '{f($underlying)} } diff --git a/tests/pos-macros/i7048c.scala b/tests/pos-macros/i7048c.scala index 0a81a7aa853a..eab352c58e09 100644 --- a/tests/pos-macros/i7048c.scala +++ b/tests/pos-macros/i7048c.scala @@ -6,7 +6,7 @@ trait IsExpr { val foo: IsExpr = ??? -def g(e: IsExpr)(using tu: Type[e.Underlying]): Unit = ??? +def g(e: IsExpr)(using tu: Staged[e.Underlying]): Unit = ??? def mcrImpl(using QuoteContext): Unit = { g(foo) diff --git a/tests/pos-macros/i7048d.scala b/tests/pos-macros/i7048d.scala index ad3577dc68f3..77d9c023c84f 100644 --- a/tests/pos-macros/i7048d.scala +++ b/tests/pos-macros/i7048d.scala @@ -6,7 +6,7 @@ trait IsExpr { val foo: IsExpr = ??? -def g(e: IsExpr)(using tu: Type[e.Underlying]): Unit = ??? +def g(e: IsExpr)(using tu: Staged[e.Underlying]): Unit = ??? def mcrImpl(using QuoteContext): Unit = { g(foo) diff --git a/tests/pos-macros/i7048e.scala b/tests/pos-macros/i7048e.scala index 145f88b5301e..43717176bc29 100644 --- a/tests/pos-macros/i7048e.scala +++ b/tests/pos-macros/i7048e.scala @@ -3,8 +3,8 @@ import scala.quoted._ abstract class Test { type T - val T: Type[T] - val getT: Type[T] = T // need this to avoid getting `null` + val T: Staged[T] + val getT: Staged[T] = T // need this to avoid getting `null` given getT.type = getT def foo(using QuoteContext): Expr[Any] = { @@ -14,7 +14,7 @@ abstract class Test { { val t: Test = this import t.{given _} - println(summon[Type[t.T]].show) + println(summon[Staged[t.T]].show) // val r = '{Option.empty[t.T]} // access to value t from wrong staging level val r2 = '{Option.empty[${t.T}]} } @@ -22,7 +22,7 @@ abstract class Test { { val r1 = '{Option.empty[${T}]} // works val r2 = '{Option.empty[List[${T}]]} // works - // val r3 = '{summon[Type[${T}]]} // access to Test.this from wrong staging level + // val r3 = '{summon[Staged[${T}]]} // access to Test.this from wrong staging level val r4 = '{summon[${T} <:< Any]} } diff --git a/tests/pos-macros/i7110a/Macro_1.scala b/tests/pos-macros/i7110a/Macro_1.scala index d35f56ba36ce..fd2535b50847 100644 --- a/tests/pos-macros/i7110a/Macro_1.scala +++ b/tests/pos-macros/i7110a/Macro_1.scala @@ -4,7 +4,7 @@ object Macros { inline def m[R](sym: Symantics[R]) : R = ${ mImpl[R]('{sym}) } - def mImpl[R: Type](using qctx: QuoteContext)(sym: Expr[Symantics[R]]): Expr[R] = '{ + def mImpl[R: Staged](using qctx: QuoteContext)(sym: Expr[Symantics[R]]): Expr[R] = '{ $sym.Meth(42) } } diff --git a/tests/pos-macros/i7110b/Macro_1.scala b/tests/pos-macros/i7110b/Macro_1.scala index 0587f403c450..e8b49de253bc 100644 --- a/tests/pos-macros/i7110b/Macro_1.scala +++ b/tests/pos-macros/i7110b/Macro_1.scala @@ -4,7 +4,7 @@ object Macros { inline def m[T](sym: Symantics {type R = T}) : T = ${ mImpl[T]('{sym}) } - def mImpl[T: Type](using qctx: QuoteContext)(sym: Expr[Symantics { type R = T }]): Expr[T] = '{ + def mImpl[T: Staged](using qctx: QuoteContext)(sym: Expr[Symantics { type R = T }]): Expr[T] = '{ $sym.Meth(42) } } diff --git a/tests/pos-macros/i7110c/Macro_1.scala b/tests/pos-macros/i7110c/Macro_1.scala index b83e3aaf594a..b7f12b1675df 100644 --- a/tests/pos-macros/i7110c/Macro_1.scala +++ b/tests/pos-macros/i7110c/Macro_1.scala @@ -4,7 +4,7 @@ object Macros { inline def m[R](sym: Symantics[R]) : R = ${ mImpl[R]('{sym}) } - def mImpl[R: Type](using qctx: QuoteContext)(sym: Expr[Symantics[R]]): Expr[R] = '{ + def mImpl[R: Staged](using qctx: QuoteContext)(sym: Expr[Symantics[R]]): Expr[R] = '{ $sym.Meth(42) } } diff --git a/tests/pos-macros/i7110f/Macro_1.scala b/tests/pos-macros/i7110f/Macro_1.scala index d35f56ba36ce..fd2535b50847 100644 --- a/tests/pos-macros/i7110f/Macro_1.scala +++ b/tests/pos-macros/i7110f/Macro_1.scala @@ -4,7 +4,7 @@ object Macros { inline def m[R](sym: Symantics[R]) : R = ${ mImpl[R]('{sym}) } - def mImpl[R: Type](using qctx: QuoteContext)(sym: Expr[Symantics[R]]): Expr[R] = '{ + def mImpl[R: Staged](using qctx: QuoteContext)(sym: Expr[Symantics[R]]): Expr[R] = '{ $sym.Meth(42) } } diff --git a/tests/pos-macros/i7262.scala b/tests/pos-macros/i7262.scala index 1c815425fcd1..59382bb64259 100644 --- a/tests/pos-macros/i7262.scala +++ b/tests/pos-macros/i7262.scala @@ -1,6 +1,6 @@ import scala.quoted._ class Foo { - def f[T](t: Type[T])(using QuoteContext) = t match { + def f[T](t: Staged[T])(using QuoteContext) = t match { case '[ Int *: EmptyTuple ] => } } diff --git a/tests/pos-macros/i7264.scala b/tests/pos-macros/i7264.scala index 0467b0714dea..d723cb2d2c0f 100644 --- a/tests/pos-macros/i7264.scala +++ b/tests/pos-macros/i7264.scala @@ -1,6 +1,6 @@ import scala.quoted._ class Foo { - def f[T2](t: Type[T2])(using QuoteContext) = t match { + def f[T2](t: Staged[T2])(using QuoteContext) = t match { case '[ *:[Int, $t] ] => '[ *:[Int, $t] ] } diff --git a/tests/pos-macros/i7264b.scala b/tests/pos-macros/i7264b.scala index 3c4f0b0a9945..f05aa777e3ca 100644 --- a/tests/pos-macros/i7264b.scala +++ b/tests/pos-macros/i7264b.scala @@ -1,6 +1,6 @@ import scala.quoted._ class Foo { - def f[T2: Type](e: Expr[T2])(using QuoteContext) = e match { + def f[T2: Staged](e: Expr[T2])(using QuoteContext) = e match { case '{ $x: *:[Int, $t] } => '[ *:[Int, $t] ] } diff --git a/tests/pos-macros/i7264c.scala b/tests/pos-macros/i7264c.scala index d246bbb23027..62140ce94fb8 100644 --- a/tests/pos-macros/i7264c.scala +++ b/tests/pos-macros/i7264c.scala @@ -1,6 +1,6 @@ import scala.quoted._ class Foo { - def f[T2: Type](e: Expr[T2])(using QuoteContext) = e match { + def f[T2: Staged](e: Expr[T2])(using QuoteContext) = e match { case '{ $x: $t0 } => t0 match case '[ *:[Int, $t] ] => diff --git a/tests/pos-macros/i7322/Macro_1.scala b/tests/pos-macros/i7322/Macro_1.scala index 296733ab36cf..c3ea06d4d30d 100644 --- a/tests/pos-macros/i7322/Macro_1.scala +++ b/tests/pos-macros/i7322/Macro_1.scala @@ -1,7 +1,7 @@ -import scala.quoted.{ QuoteContext, Expr, Type } +import scala.quoted.{ QuoteContext, Expr, Staged, Type } trait M[T] { def f: Any } -inline def g[T: Type](em: Expr[M[T]])(using QuoteContext) = '{$em.f} \ No newline at end of file +inline def g[T: Staged](em: Expr[M[T]])(using QuoteContext) = '{$em.f} diff --git a/tests/pos-macros/i7358.scala b/tests/pos-macros/i7358.scala index 8aa6cc5d280a..1a4094c24b77 100644 --- a/tests/pos-macros/i7358.scala +++ b/tests/pos-macros/i7358.scala @@ -8,9 +8,9 @@ transparent inline def summonT[Tp <: Tuple](using QuoteContext): Tuple = inline case _ : (hd *: tl) => { type H = hd summonFrom { - case given _ : Type[H] => summon[Type[H]] *: summonT[tl] + case given _ : Staged[H] => summon[Staged[H]] *: summonT[tl] } } } -def test[T : Type](using QuoteContext) = summonT[Tuple1[List[T]]] +def test[T : Staged](using QuoteContext) = summonT[Tuple1[List[T]]] diff --git a/tests/pos-macros/i7405.scala b/tests/pos-macros/i7405.scala index 4526758501d8..bb2aea2ba938 100644 --- a/tests/pos-macros/i7405.scala +++ b/tests/pos-macros/i7405.scala @@ -5,7 +5,7 @@ class Foo { type X = Int // Level 1 val x: X = ??? ${ - val t: Type[X] = '[X] // Level 0 + val t: Staged[X] = '[X] // Level 0 '{ val y: $t = x } } } diff --git a/tests/pos-macros/i7405b.scala b/tests/pos-macros/i7405b.scala index f2fb52b02d60..57608d003ca7 100644 --- a/tests/pos-macros/i7405b.scala +++ b/tests/pos-macros/i7405b.scala @@ -10,7 +10,7 @@ class Foo { val x: X = ??? type Z = x.Y ${ - val t: Type[Z] = '[Z] + val t: Staged[Z] = '[Z] '{ val y: $t = x.y } } } diff --git a/tests/pos-macros/i7519.scala b/tests/pos-macros/i7519.scala index 7e6c6322e5cb..b0d8eeeac368 100644 --- a/tests/pos-macros/i7519.scala +++ b/tests/pos-macros/i7519.scala @@ -7,7 +7,7 @@ object Test { class Quoted[T] inline def quote[T]: Quoted[T] = ${ quoteImpl[T] } - def quoteImpl[T: Type](using qctx: QuoteContext): Expr[Quoted[T]] = '{ + def quoteImpl[T: Staged](using qctx: QuoteContext): Expr[Quoted[T]] = '{ new Quoted[T @Annot] } } diff --git a/tests/pos-macros/i7519b.scala b/tests/pos-macros/i7519b.scala index 63ac578b5a83..c300ffc23bfb 100644 --- a/tests/pos-macros/i7519b.scala +++ b/tests/pos-macros/i7519b.scala @@ -7,7 +7,7 @@ class Quoted[T] inline def quote[T]: Quoted[T] = ${ quoteImpl[T] } -def quoteImpl[T: Type](using qctx: QuoteContext): Expr[Quoted[T]] = { +def quoteImpl[T: Staged](using qctx: QuoteContext): Expr[Quoted[T]] = { val value: Expr[Int] = '{ 42 } '{ new Quoted[T @Annot($value)] } } diff --git a/tests/pos-macros/i7521.scala b/tests/pos-macros/i7521.scala index 3dfa925dedf5..64dc7dcc71e7 100644 --- a/tests/pos-macros/i7521.scala +++ b/tests/pos-macros/i7521.scala @@ -3,7 +3,7 @@ import scala.annotation.StaticAnnotation object Test { inline def quote[T]: Unit = ${ quoteImpl[T] } - def quoteImpl[T: Type](using qctx: QuoteContext): Expr[Unit] = '{ + def quoteImpl[T: Staged](using qctx: QuoteContext): Expr[Unit] = '{ class Annot extends StaticAnnotation var test: T @Annot = ??? } diff --git a/tests/pos-macros/i7887.scala b/tests/pos-macros/i7887.scala index 773da5c713c3..8d193c4fd0c5 100644 --- a/tests/pos-macros/i7887.scala +++ b/tests/pos-macros/i7887.scala @@ -1,4 +1,4 @@ -def typed[A](using t: quoted.Type[A], qctx: quoted.QuoteContext): Unit = { +def typed[A](using t: quoted.Staged[A], qctx: quoted.QuoteContext): Unit = { import qctx.tasty._ '{ type T = $t diff --git a/tests/pos-macros/i8052.scala b/tests/pos-macros/i8052.scala index 6bae471bdfd8..bde7a4e7c724 100644 --- a/tests/pos-macros/i8052.scala +++ b/tests/pos-macros/i8052.scala @@ -8,7 +8,7 @@ object Macro2 { } object TC { - def derived[T: Type](ev: Expr[Mirror.Of[T]])(using qctx: QuoteContext): Expr[TC[T]] = '{ + def derived[T: Staged](ev: Expr[Mirror.Of[T]])(using qctx: QuoteContext): Expr[TC[T]] = '{ new TC[T] { def encode(): Unit = ${ ev match { diff --git a/tests/pos-macros/i8100.scala b/tests/pos-macros/i8100.scala index 374d9e086ac7..9fe9613ba889 100644 --- a/tests/pos-macros/i8100.scala +++ b/tests/pos-macros/i8100.scala @@ -4,7 +4,7 @@ class M { type E } -def f[T: Type](using QuoteContext) = +def f[T: Staged](using QuoteContext) = Expr.summon[M] match case Some('{ $mm : $tt }) => '{ @@ -18,4 +18,4 @@ def f[T: Type](using QuoteContext) = // ${ g[m.E] } // FIXME: issue seems to be in ReifyQuotes } -def g[T](using Type[T]) = ??? +def g[T](using Staged[T]) = ??? diff --git a/tests/pos-macros/i8302.scala b/tests/pos-macros/i8302.scala index 46fd22acc7e0..f7c57770f6cb 100644 --- a/tests/pos-macros/i8302.scala +++ b/tests/pos-macros/i8302.scala @@ -1,5 +1,5 @@ import scala.quoted._ -def foo[T](using qctx: QuoteContext, tpe: Type[T]): Expr[Any] = +def foo[T](using qctx: QuoteContext, tpe: Staged[T]): Expr[Any] = '{ (using qctx: QuoteContext) => type TT = T val t = '[TT] diff --git a/tests/pos-macros/i8325/Macro_1.scala b/tests/pos-macros/i8325/Macro_1.scala index 5e03cbce2a32..7e457f7b9993 100644 --- a/tests/pos-macros/i8325/Macro_1.scala +++ b/tests/pos-macros/i8325/Macro_1.scala @@ -11,7 +11,7 @@ object A: def pure[A](a:A):A = ??? - def transformImplExpr[A:Type](using qctx: QuoteContext)(expr: Expr[A]): Expr[A] = { + def transformImplExpr[A: Staged](using qctx: QuoteContext)(expr: Expr[A]): Expr[A] = { import qctx.tasty._ expr.unseal match { case Inlined(x,y,z) => transformImplExpr(z.seal.asInstanceOf[Expr[A]]) diff --git a/tests/pos-macros/i8325b/Macro_1.scala b/tests/pos-macros/i8325b/Macro_1.scala index 050d0b7ccb4c..4fd712e11476 100644 --- a/tests/pos-macros/i8325b/Macro_1.scala +++ b/tests/pos-macros/i8325b/Macro_1.scala @@ -11,7 +11,7 @@ object A: def pure[A](a:A):A = ??? - def transformImplExpr[A:Type](using qctx: QuoteContext)(expr: Expr[A]): Expr[A] = { + def transformImplExpr[A: Staged](using qctx: QuoteContext)(expr: Expr[A]): Expr[A] = { import qctx.tasty._ expr.unseal match { case Inlined(x,y,z) => transformImplExpr(z.seal.asInstanceOf[Expr[A]]) diff --git a/tests/pos-macros/i8651b.scala b/tests/pos-macros/i8651b.scala index 2ee40e81acc5..ed80f402cfcb 100644 --- a/tests/pos-macros/i8651b.scala +++ b/tests/pos-macros/i8651b.scala @@ -8,7 +8,7 @@ object Macros { inline def coroutine[T](inline body: Any): Coroutine[T] = ${ coroutineImpl('{body}) } - def coroutineImpl[T: Type](expr: Expr[_ <: Any])(implicit qtx: QuoteContext): Expr[Coroutine[T]] = { + def coroutineImpl[T: Staged](expr: Expr[_ <: Any])(implicit qtx: QuoteContext): Expr[Coroutine[T]] = { import qtx.tasty.{_, given _} '{ diff --git a/tests/pos-macros/i8871.scala b/tests/pos-macros/i8871.scala new file mode 100644 index 000000000000..e9a57ca9104e --- /dev/null +++ b/tests/pos-macros/i8871.scala @@ -0,0 +1,8 @@ +import scala.quoted._ +object Macro { + def impl[A : Staged](using qctx: QuoteContext): Unit = { + import qctx.tasty._ + val tpe = typeOf[A].seal.asInstanceOf[quoted.Staged[_ <: AnyRef]] + '{ (a: ${tpe}) => ???} + } +} diff --git a/tests/pos-macros/i8871b.scala b/tests/pos-macros/i8871b.scala new file mode 100644 index 000000000000..797e51f1a2a1 --- /dev/null +++ b/tests/pos-macros/i8871b.scala @@ -0,0 +1,9 @@ +import scala.quoted._ +object Macro { + def impl[A : Staged](using qctx: QuoteContext): Unit = { + import qctx.tasty._ + val tpe/*: quoted.Type */ = typeOf[A].seal + '{ f[$tpe] } + } + def f[T <: AnyKind]: Unit = () +} diff --git a/tests/pos-macros/i8879/Macro_1.scala b/tests/pos-macros/i8879/Macro_1.scala index fda2363167b0..3d6f3cd0a8b4 100644 --- a/tests/pos-macros/i8879/Macro_1.scala +++ b/tests/pos-macros/i8879/Macro_1.scala @@ -4,7 +4,7 @@ object Test { import scala.quoted._ - def impl[T](t: T)(using qctx: QuoteContext, tt: Type[T]): Expr[Any] = { + def impl[T](t: T)(using qctx: QuoteContext, tt: Staged[T]): Expr[Any] = { import qctx.tasty._ import util._ diff --git a/tests/pos-macros/i9020-a/Macro_1.scala b/tests/pos-macros/i9020-a/Macro_1.scala index b26764654570..407793e5a7c1 100644 --- a/tests/pos-macros/i9020-a/Macro_1.scala +++ b/tests/pos-macros/i9020-a/Macro_1.scala @@ -6,7 +6,7 @@ object Show { inline def deriveWithMacro[T]: Show[T] = ${ impl[T] } import quoted._ - def impl[T](using ctx: QuoteContext, tpe: Type[T]): Expr[Show[T]] = + def impl[T](using ctx: QuoteContext, tpe: Staged[T]): Expr[Show[T]] = '{ new Show[T] { def show(t: T): String = "TODO" diff --git a/tests/pos-macros/i9020-b/Macro_1.scala b/tests/pos-macros/i9020-b/Macro_1.scala index 2062988d3f00..eb96423a39b7 100644 --- a/tests/pos-macros/i9020-b/Macro_1.scala +++ b/tests/pos-macros/i9020-b/Macro_1.scala @@ -6,7 +6,7 @@ object Show { inline def deriveWithMacro[T]: Show[T] = ${ impl[T] } import quoted._ - def impl[T](using ctx: QuoteContext, tpe: Type[T]): Expr[Show[T]] = + def impl[T](using ctx: QuoteContext, tpe: Staged[T]): Expr[Show[T]] = '{ new Show[$tpe] { def show(t: $tpe): String = "TODO" diff --git a/tests/pos-macros/i9240/Macro_1.scala b/tests/pos-macros/i9240/Macro_1.scala index 7f85002816ff..8e4cd0e72aec 100644 --- a/tests/pos-macros/i9240/Macro_1.scala +++ b/tests/pos-macros/i9240/Macro_1.scala @@ -3,7 +3,7 @@ import scala.tasty._ inline def diveInto[T]: String = ${ diveIntoImpl[T]() } -def diveIntoImpl[T]()(implicit qctx: QuoteContext, ttype: scala.quoted.Type[T]): Expr[String] = +def diveIntoImpl[T]()(implicit qctx: QuoteContext, ttype: scala.quoted.Staged[T]): Expr[String] = import qctx.tasty._ Expr( unwindType(qctx.tasty)(typeOf[T]) ) diff --git a/tests/pos-macros/i9251/Macro_1.scala b/tests/pos-macros/i9251/Macro_1.scala index 2e9ccf5685cf..5c757b0c5410 100644 --- a/tests/pos-macros/i9251/Macro_1.scala +++ b/tests/pos-macros/i9251/Macro_1.scala @@ -18,7 +18,7 @@ object Async { } - def checkPrintTypeImpl[F[_]:Type,T:Type](f: Expr[T])(using qctx: QuoteContext): Expr[Unit] = + def checkPrintTypeImpl[F[_]: Staged,T: Staged](f: Expr[T])(using qctx: QuoteContext): Expr[Unit] = import qctx.tasty._ val fu = f.unseal @@ -26,7 +26,7 @@ object Async { case Inlined(_,_,Block(_,Apply(TypeApply(Select(q,n),tparams),List(param)))) => param.tpe match case AppliedType(tp,tparams1) => - val fType = summon[quoted.Type[F]] + val fType = summon[quoted.Staged[F]] val ptp = tparams1.tail.head val ptpTree = Inferred(AppliedType(fType.unseal.tpe,List(ptp))) '{ println(${Expr(ptpTree.show)}) } diff --git a/tests/pos-macros/macro-docs.scala b/tests/pos-macros/macro-docs.scala index bebe01cc3d66..c6403e0b241d 100644 --- a/tests/pos-macros/macro-docs.scala +++ b/tests/pos-macros/macro-docs.scala @@ -17,7 +17,7 @@ object MacrosMD_Liftable { } } - given [T: Liftable : Type] as Liftable[List[T]] { + given [T: Liftable : Staged] as Liftable[List[T]] { def toExpr(xs: List[T]) = xs match { case head :: tail => '{ ${ Expr(head) } :: ${ toExpr(tail) } } case Nil => '{ Nil: List[T] } diff --git a/tests/pos-macros/macro-with-type/Macro_1.scala b/tests/pos-macros/macro-with-type/Macro_1.scala index 3a00191873d5..cffce1a784df 100644 --- a/tests/pos-macros/macro-with-type/Macro_1.scala +++ b/tests/pos-macros/macro-with-type/Macro_1.scala @@ -1,5 +1,5 @@ import scala.quoted._ object Macro { inline def ff: Unit = ${impl('[Int])} - def impl(t: Type[Int])(using QuoteContext): Expr[Unit] = '{} + def impl(t: Staged[Int])(using QuoteContext): Expr[Unit] = '{} } diff --git a/tests/pos-macros/quote-1.scala b/tests/pos-macros/quote-1.scala index 1f02e1fb9233..f9af610fca8a 100644 --- a/tests/pos-macros/quote-1.scala +++ b/tests/pos-macros/quote-1.scala @@ -2,7 +2,7 @@ import scala.quoted._ class Test(using QuoteContext) { - def f[T](x: Expr[T])(implicit t: Type[T]) = '{ + def f[T](x: Expr[T])(implicit t: Staged[T]) = '{ val y: $t = $x val z = $x } @@ -10,6 +10,6 @@ class Test(using QuoteContext) { f('{2})('[Int]) f('{ true })('[Boolean]) - def g(es: Expr[String], t: Type[String]) = + def g(es: Expr[String], t: Staged[String]) = f('{ ($es + "!") :: Nil })('[List[$t]]) } diff --git a/tests/pos-macros/quote-bind-T.scala b/tests/pos-macros/quote-bind-T.scala index eea1f0d901b5..4a945655636f 100644 --- a/tests/pos-macros/quote-bind-T.scala +++ b/tests/pos-macros/quote-bind-T.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Test { - def matchX[T](x: Expr[T])(using Type[T], QuoteContext): Expr[T] = '{ + def matchX[T](x: Expr[T])(using Staged[T], QuoteContext): Expr[T] = '{ $x match { case y: T => y } diff --git a/tests/pos-macros/quote-liftable-list-2.scala b/tests/pos-macros/quote-liftable-list-2.scala index 8071e5771fee..450762a97c2b 100644 --- a/tests/pos-macros/quote-liftable-list-2.scala +++ b/tests/pos-macros/quote-liftable-list-2.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Test { - implicit def ListIsLiftableOr[T: Type, U: Type]: Liftable[List[T | U]] = new { + implicit def ListIsLiftableOr[T: Staged, U: Staged]: Liftable[List[T | U]] = new { def toExpr(xs: List[T | U]) = '{ Nil: List[T | U] } } diff --git a/tests/pos-macros/quote-liftable-list-3.scala b/tests/pos-macros/quote-liftable-list-3.scala index 4118df7d92a7..52afdd22edb0 100644 --- a/tests/pos-macros/quote-liftable-list-3.scala +++ b/tests/pos-macros/quote-liftable-list-3.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Test { - implicit def ListIsLiftableAnd[T: Type, U: Type]: Liftable[List[T & U]] = new { + implicit def ListIsLiftableAnd[T: Staged, U: Staged]: Liftable[List[T & U]] = new { def toExpr(xs: List[T & U]) = '{ Nil: List[T & U] } } diff --git a/tests/pos-macros/quote-liftable-list.scala b/tests/pos-macros/quote-liftable-list.scala index c2c4af24341b..348b83d7305f 100644 --- a/tests/pos-macros/quote-liftable-list.scala +++ b/tests/pos-macros/quote-liftable-list.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Test { - implicit def ListIsLiftable[T: Liftable: Type]: Liftable[List[T]] = new { + implicit def ListIsLiftable[T: Liftable: Staged]: Liftable[List[T]] = new { def toExpr(xs: List[T]) = '{ Nil: List[T] } } diff --git a/tests/pos-macros/quote-liftable.scala b/tests/pos-macros/quote-liftable.scala index eb71ffb5647e..d674a2f74067 100644 --- a/tests/pos-macros/quote-liftable.scala +++ b/tests/pos-macros/quote-liftable.scala @@ -19,7 +19,7 @@ def test(using QuoteContext) = { if (b) '{true} else '{false} } - implicit def ListIsLiftable[T: Liftable: Type]: Liftable[List[T]] = new { + implicit def ListIsLiftable[T: Liftable: Staged]: Liftable[List[T]] = new { def toExpr(xs: List[T]) = xs match { case x :: xs1 => '{ ${ Expr(x) } :: ${ toExpr(xs1) } } case Nil => '{Nil: List[T]} diff --git a/tests/pos-macros/quote-matching-implicit-types.scala b/tests/pos-macros/quote-matching-implicit-types.scala index f7c2edf88c4d..1839f547bfde 100644 --- a/tests/pos-macros/quote-matching-implicit-types.scala +++ b/tests/pos-macros/quote-matching-implicit-types.scala @@ -11,6 +11,6 @@ object Foo { def foo[T](t: T): Unit = () - def bar[T: Type](t: Expr[T]): Boolean = true + def bar[T: Staged](t: Expr[T]): Boolean = true } diff --git a/tests/pos-macros/quoted-pattern-type.scala b/tests/pos-macros/quoted-pattern-type.scala index 9b6c06601bb3..803ebe95df6e 100644 --- a/tests/pos-macros/quoted-pattern-type.scala +++ b/tests/pos-macros/quoted-pattern-type.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Lib { - def impl[T: Type](arg: Expr[T])(using QuoteContext): Expr[T] = { + def impl[T: Staged](arg: Expr[T])(using QuoteContext): Expr[T] = { arg match { case e @ '{ $x: Boolean } => e: Expr[T & Boolean] diff --git a/tests/pos-macros/quoted-var.scala b/tests/pos-macros/quoted-var.scala index 7de01c9bb540..4723e080f369 100644 --- a/tests/pos-macros/quoted-var.scala +++ b/tests/pos-macros/quoted-var.scala @@ -3,7 +3,7 @@ import scala.quoted._ class Var[T] object Var { - def apply[T: Type, U: Type](init: Expr[T])(body: Var[T] => Expr[U])(using qctx: QuoteContext): Expr[U] = '{ + def apply[T: Staged, U: Staged](init: Expr[T])(body: Var[T] => Expr[U])(using qctx: QuoteContext): Expr[U] = '{ var x = $init ${ body( diff --git a/tests/pos-macros/quotedPatterns.scala b/tests/pos-macros/quotedPatterns.scala index 3a7248fdfef6..81324ee76805 100644 --- a/tests/pos-macros/quotedPatterns.scala +++ b/tests/pos-macros/quotedPatterns.scala @@ -35,6 +35,6 @@ object Test { def poly[T](x: T): Unit = () object Foo { - def unapply[T](arg: quoted.Type[T]): Option[quoted.Type[T]] = Some(arg) + def unapply[T](arg: quoted.Staged[T]): Option[quoted.Staged[T]] = Some(arg) } } \ No newline at end of file diff --git a/tests/pos-macros/tasty-constant-type/Macro_1.scala b/tests/pos-macros/tasty-constant-type/Macro_1.scala index ba80aeac793c..9690c0d65046 100644 --- a/tests/pos-macros/tasty-constant-type/Macro_1.scala +++ b/tests/pos-macros/tasty-constant-type/Macro_1.scala @@ -6,7 +6,7 @@ object Macro { transparent inline def ff[A <: Int, B <: Int](): AddInt[A, B] = ${ impl('[A], '[B]) } - def impl[A <: Int : Type, B <: Int : Type](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[AddInt[A, B]] = { + def impl[A <: Int : Staged, B <: Int : Staged](a: Staged[A], b: Staged[B])(using qctx: QuoteContext) : Expr[AddInt[A, B]] = { import qctx.tasty._ val ConstantType(Constant(v1: Int)) = a.unseal.tpe diff --git a/tests/pos-macros/typetags.scala b/tests/pos-macros/typetags.scala index c3dc50fceb89..97dd31a0cff2 100644 --- a/tests/pos-macros/typetags.scala +++ b/tests/pos-macros/typetags.scala @@ -2,10 +2,10 @@ import scala.quoted._ object Test { - def f[T: Type](using QuoteContext) = { - implicitly[Type[Int]] - implicitly[Type[List[Int]]] - implicitly[Type[T]] - implicitly[Type[List[T]]] + def f[T: Staged](using QuoteContext) = { + implicitly[Staged[Int]] + implicitly[Staged[List[Int]]] + implicitly[Staged[T]] + implicitly[Staged[List[T]]] } } diff --git a/tests/pos-macros/using-quote-context.scala b/tests/pos-macros/using-quote-context.scala index 51205190ecbd..9c43aa9dfb33 100644 --- a/tests/pos-macros/using-quote-context.scala +++ b/tests/pos-macros/using-quote-context.scala @@ -1,6 +1,6 @@ import scala.quoted._ class Test { - def fold[W: Type](s: Expr[W]): QuoteContext ?=> Expr[W] = + def fold[W: Staged](s: Expr[W]): QuoteContext ?=> Expr[W] = '{ ???; $s } } diff --git a/tests/pos/i6693.scala b/tests/pos/i6693.scala index 7d57950f5ef8..28852a10ebe6 100644 --- a/tests/pos/i6693.scala +++ b/tests/pos/i6693.scala @@ -8,9 +8,9 @@ object Computes { opaque type Opaque[T] = Int - implicit class ComputesApplication1[T : Type](fn : Computes[Opaque[T]]) { + implicit class ComputesApplication1[T : Staged](fn : Computes[Opaque[T]]) { def apply[A](arg1 : Computes[A]) : Computes[T] = ??? } - def let[V, T : Type](value : Computes[V], body : Computes[Opaque[T]]) : Computes[T] = body(value) + def let[V, T : Staged](value : Computes[V], body : Computes[Opaque[T]]) : Computes[T] = body(value) } 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 ef3840d8e67e..044b048e80b2 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 @@ -3,7 +3,7 @@ import scala.quoted._ inline def isFunctionType[T]: Boolean = ${ isFunctionTypeImpl('[T]) } -def isFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { +def isFunctionTypeImpl[T](tp: Staged[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ Expr(tp.unseal.tpe.isFunctionType) } @@ -11,7 +11,7 @@ def isFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] inline def isContextFunctionType[T]: Boolean = ${ isContextFunctionTypeImpl('[T]) } -def isContextFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { +def isContextFunctionTypeImpl[T](tp: Staged[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ Expr(tp.unseal.tpe.isContextFunctionType) } @@ -19,14 +19,14 @@ def isContextFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[B inline def isErasedFunctionType[T]: Boolean = ${ isErasedFunctionTypeImpl('[T]) } -def isErasedFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { +def isErasedFunctionTypeImpl[T](tp: Staged[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ Expr(tp.unseal.tpe.isErasedFunctionType) } inline def isDependentFunctionType[T]: Boolean = ${ isDependentFunctionTypeImpl('[T]) } -def isDependentFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { +def isDependentFunctionTypeImpl[T](tp: Staged[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ Expr(tp.unseal.tpe.isDependentFunctionType) } diff --git a/tests/run-macros/expr-map-1/Macro_1.scala b/tests/run-macros/expr-map-1/Macro_1.scala index 3f5ab3b2d1d4..8fc096d155e1 100644 --- a/tests/run-macros/expr-map-1/Macro_1.scala +++ b/tests/run-macros/expr-map-1/Macro_1.scala @@ -8,7 +8,7 @@ private def stringRewriter(e: Expr[Any])(using QuoteContext): Expr[Any] = private object StringRewriter extends util.ExprMap { - def transform[T](e: Expr[T])(using QuoteContext, Type[T]): Expr[T] = e match + def transform[T](e: Expr[T])(using QuoteContext, Staged[T]): Expr[T] = e match case Const(s: String) => Expr(s.reverse) match case '{ $x: T } => x diff --git a/tests/run-macros/expr-map-2/Macro_1.scala b/tests/run-macros/expr-map-2/Macro_1.scala index 86e5c713d5fe..c3d7042542d9 100644 --- a/tests/run-macros/expr-map-2/Macro_1.scala +++ b/tests/run-macros/expr-map-2/Macro_1.scala @@ -8,7 +8,7 @@ private def stringRewriter(e: Expr[Any])(using QuoteContext): Expr[Any] = private object StringRewriter extends util.ExprMap { - def transform[T](e: Expr[T])(using QuoteContext, Type[T]): Expr[T] = e match + def transform[T](e: Expr[T])(using QuoteContext, Staged[T]): Expr[T] = e match case '{ ($x: Foo).x } => '{ new Foo(4).x } match case '{ $e: T } => 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..c56f7002b757 100644 --- a/tests/run-macros/flops-rewrite-2/Macro_1.scala +++ b/tests/run-macros/flops-rewrite-2/Macro_1.scala @@ -7,7 +7,7 @@ def plus(x: Int, y: Int): Int = x + y def times(x: Int, y: Int): Int = x * y def power(x: Int, y: Int): Int = if y == 0 then 1 else times(x, power(x, y - 1)) -private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { +private def rewriteMacro[T: Staged](x: Expr[T])(using QuoteContext): Expr[T] = { val rewriter = Rewriter( postTransform = List( Transformation[Int] { @@ -46,11 +46,11 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { } object Transformation { - def apply[T: Type](transform: PartialFunction[Expr[T], Expr[T]]) = + def apply[T: Staged](transform: PartialFunction[Expr[T], Expr[T]]) = new Transformation(transform) } -class Transformation[T: Type](transform: PartialFunction[Expr[T], Expr[T]]) { - def apply[U: Type](e: Expr[U])(using QuoteContext): Expr[U] = { +class Transformation[T: Staged](transform: PartialFunction[Expr[T], Expr[T]]) { + def apply[U: Staged](e: Expr[U])(using QuoteContext): Expr[U] = { e match { case '{ $e: T } => transform.applyOrElse(e, identity) match { case '{ $e2: U } => e2 } case e => e @@ -64,7 +64,7 @@ private object Rewriter { } private class Rewriter(preTransform: List[Transformation[_]] = Nil, postTransform: List[Transformation[_]] = Nil, fixPoint: Boolean) extends util.ExprMap { - def transform[T](e: Expr[T])(using QuoteContext, Type[T]): Expr[T] = { + def transform[T](e: Expr[T])(using QuoteContext, Staged[T]): Expr[T] = { val e2 = preTransform.foldLeft(e)((ei, transform) => transform(ei)) val e3 = transformChildren(e2) val e4 = postTransform.foldLeft(e3)((ei, transform) => transform(ei)) diff --git a/tests/run-macros/flops-rewrite-3/Macro_1.scala b/tests/run-macros/flops-rewrite-3/Macro_1.scala index dd6f196ec266..6b9a3d0d04ca 100644 --- a/tests/run-macros/flops-rewrite-3/Macro_1.scala +++ b/tests/run-macros/flops-rewrite-3/Macro_1.scala @@ -7,7 +7,7 @@ def plus(x: Int, y: Int): Int = x + y def times(x: Int, y: Int): Int = x * y def power(x: Int, y: Int): Int = if y == 0 then 1 else times(x, power(x, y - 1)) -private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { +private def rewriteMacro[T: Staged](x: Expr[T])(using QuoteContext): Expr[T] = { val rewriter = Rewriter().withFixPoint.withPost( Transformation.safe[Int] { case '{ plus($x, $y) } => @@ -45,7 +45,7 @@ private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { object Transformation { /** A restrictive transformer that is guaranteed to generate type correct code */ - def safe[T: Type](transform: PartialFunction[Expr[T], Expr[T]]): Transformation = + def safe[T: Staged](transform: PartialFunction[Expr[T], Expr[T]]): Transformation = new SafeTransformation(transform) /** A general purpose transformer that may fail while transforming. @@ -56,7 +56,7 @@ object Transformation { } class CheckedTransformation(transform: PartialFunction[Expr[Any], Expr[Any]]) extends Transformation { - def apply[T: Type](e: Expr[T])(using QuoteContext): Expr[T] = { + def apply[T: Staged](e: Expr[T])(using QuoteContext): Expr[T] = { transform.applyOrElse(e, identity) match { case '{ $e2: T } => e2 case '{ $e2: $t } => @@ -67,7 +67,7 @@ class CheckedTransformation(transform: PartialFunction[Expr[Any], Expr[Any]]) ex |${e2.show} | |Expected type to be - |${summon[Type[T]].show} + |${summon[Staged[T]].show} |but was |${t.show} """.stripMargin) @@ -75,8 +75,8 @@ class CheckedTransformation(transform: PartialFunction[Expr[Any], Expr[Any]]) ex } } -class SafeTransformation[U: Type](transform: PartialFunction[Expr[U], Expr[U]]) extends Transformation { - def apply[T: Type](e: Expr[T])(using QuoteContext): Expr[T] = { +class SafeTransformation[U: Staged](transform: PartialFunction[Expr[U], Expr[U]]) extends Transformation { + def apply[T: Staged](e: Expr[T])(using QuoteContext): Expr[T] = { e match { case '{ $e: U } => transform.applyOrElse(e, identity) match { case '{ $e2: T } => e2 } case e => e @@ -85,7 +85,7 @@ class SafeTransformation[U: Type](transform: PartialFunction[Expr[U], Expr[U]]) } abstract class Transformation { - def apply[T: Type](e: Expr[T])(using QuoteContext): Expr[T] + def apply[T: Staged](e: Expr[T])(using QuoteContext): Expr[T] } private object Rewriter { @@ -101,7 +101,7 @@ private class Rewriter private (preTransform: List[Transformation] = Nil, postTr def withPost(transform: Transformation): Rewriter = new Rewriter(preTransform, transform :: postTransform, fixPoint) - def transform[T](e: Expr[T])(using QuoteContext, Type[T]): Expr[T] = { + def transform[T](e: Expr[T])(using QuoteContext, Staged[T]): Expr[T] = { val e2 = preTransform.foldLeft(e)((ei, transform) => transform(ei)) val e3 = transformChildren(e2) val e4 = postTransform.foldLeft(e3)((ei, transform) => transform(ei)) diff --git a/tests/run-macros/flops-rewrite/Macro_1.scala b/tests/run-macros/flops-rewrite/Macro_1.scala index 2722623dac26..5421235a6935 100644 --- a/tests/run-macros/flops-rewrite/Macro_1.scala +++ b/tests/run-macros/flops-rewrite/Macro_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ inline def rewrite[T](inline x: T): T = ${ rewriteMacro('x) } -private def rewriteMacro[T: Type](x: Expr[T])(using QuoteContext): Expr[T] = { +private def rewriteMacro[T: Staged](x: Expr[T])(using QuoteContext): Expr[T] = { val rewriter = Rewriter( postTransform = { case '{ Nil.map[$t]($f) } => '{ Nil } @@ -29,7 +29,7 @@ private object Rewriter { } private class Rewriter(preTransform: Expr[Any] => Expr[Any], postTransform: Expr[Any] => Expr[Any], fixPoint: Boolean) extends util.ExprMap { - def transform[T](e: Expr[T])(using QuoteContext, Type[T]): Expr[T] = { + def transform[T](e: Expr[T])(using QuoteContext, Staged[T]): Expr[T] = { val e2 = checkedTransform(e, preTransform) val e3 = transformChildren(e2) val e4 = checkedTransform(e3, postTransform) @@ -37,7 +37,7 @@ private class Rewriter(preTransform: Expr[Any] => Expr[Any], postTransform: Expr else e4 } - private def checkedTransform[T: Type](e: Expr[T], transform: Expr[T] => Expr[Any])(using QuoteContext): Expr[T] = { + private def checkedTransform[T: Staged](e: Expr[T], transform: Expr[T] => Expr[Any])(using QuoteContext): Expr[T] = { transform(e) match { case '{ $x: T } => x case '{ $x: $t } => throw new Exception( @@ -47,7 +47,7 @@ private class Rewriter(preTransform: Expr[Any] => Expr[Any], postTransform: Expr |${x.show} | |Expected type to be - |${summon[Type[T]].show} + |${summon[Staged[T]].show} |but was |${t.show} """.stripMargin) diff --git a/tests/run-macros/gestalt-optional-staging/Macro_1.scala b/tests/run-macros/gestalt-optional-staging/Macro_1.scala index 9e0ad715a723..2e0c4ba0dc23 100644 --- a/tests/run-macros/gestalt-optional-staging/Macro_1.scala +++ b/tests/run-macros/gestalt-optional-staging/Macro_1.scala @@ -17,12 +17,12 @@ final class Optional[+A >: Null](val value: A) extends AnyVal { object Optional { // FIXME fix issue #5097 and enable private - /*private*/ def getOrElseImpl[T >: Null : Type](opt: Expr[Optional[T]], alt: Expr[T])(using QuoteContext): Expr[T] = '{ + /*private*/ def getOrElseImpl[T >: Null : Staged](opt: Expr[Optional[T]], alt: Expr[T])(using QuoteContext): Expr[T] = '{ if ($opt.isEmpty) $alt else $opt.value } // FIXME fix issue #5097 and enable private - /*private*/ def mapImpl[A >: Null : Type, B >: Null : Type](opt: Expr[Optional[A]], f: Expr[A => B])(using QuoteContext): Expr[Optional[B]] = '{ + /*private*/ def mapImpl[A >: Null : Staged, B >: Null : Staged](opt: Expr[Optional[A]], f: Expr[A => B])(using QuoteContext): Expr[Optional[B]] = '{ if ($opt.isEmpty) new Optional(null) else new Optional(${Expr.betaReduce(f)('{$opt.value})}) } 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 be0e7a275917..cd2e1ac050b1 100644 --- a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala +++ b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala @@ -6,28 +6,28 @@ import scala.quoted._ object TypeToolbox { /** are the two types equal? */ inline def =:=[A, B]: Boolean = ${tpEqImpl('[A], '[B])} - private def tpEqImpl[A, B](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[Boolean] = { + private def tpEqImpl[A, B](a: Staged[A], b: Staged[B])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ Expr(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] = { + private def tpLEqImpl[A, B](a: Staged[A], b: Staged[B])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ Expr(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] = { + private def typeOfImpl(a: Expr[_], expected: Staged[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ Expr(a.unseal.tpe =:= expected.unseal.tpe) } /** does the type refer to a case class? */ inline def isCaseClass[A]: Boolean = ${isCaseClassImpl('[A])} - private def isCaseClassImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { + private def isCaseClassImpl(tp: Staged[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ val sym = tp.unseal.symbol Expr(sym.isClassDef && sym.flags.is(Flags.Case)) @@ -35,66 +35,66 @@ object TypeToolbox { /** val fields of a case class Type -- only the ones declared in primary constructor */ inline def caseFields[T]: List[String] = ${caseFieldsImpl('[T])} - private def caseFieldsImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[List[String]] = { + private def caseFieldsImpl(tp: Staged[_])(using qctx: QuoteContext) : Expr[List[String]] = { import qctx.tasty._ val fields = tp.unseal.symbol.caseFields.map(_.name) Expr(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] = { + private def fieldInImpl(t: Staged[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ val field = t.unseal.symbol.field(mem.unliftOrError) Expr(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]] = { + private def fieldsInImpl(t: Staged[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ val fields = t.unseal.symbol.fields Expr(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]] = { + private def methodInImpl(t: Staged[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ Expr(t.unseal.symbol.classMethod(mem.unliftOrError).map(_.name)) } inline def methodsIn[T]: Seq[String] = ${methodsInImpl('[T])} - private def methodsInImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { + private def methodsInImpl(t: Staged[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ Expr(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]] = { + private def methodImpl(t: Staged[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ Expr(t.unseal.symbol.method(mem.unliftOrError).map(_.name)) } inline def methods[T]: Seq[String] = ${methodsImpl('[T])} - private def methodsImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { + private def methodsImpl(t: Staged[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ Expr(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] = { + private def typeTagImpl(tp: Staged[_])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ val res = tp.unseal.tpe.show Expr(res) } inline def companion[T1, T2]: Boolean = ${companionImpl('[T1], '[T2])} - private def companionImpl(t1: Type[_], t2: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { + private def companionImpl(t1: Staged[_], t2: Staged[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.tasty._ val res = t1.unseal.symbol.companionModule == t2.unseal.symbol Expr(res) } inline def companionName[T1]: String = ${companionNameImpl('[T1])} - private def companionNameImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[String] = { + private def companionNameImpl(tp: Staged[_])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ val sym = tp.unseal.symbol val companionClass = diff --git a/tests/run-macros/i4515/Macro_1.scala b/tests/run-macros/i4515/Macro_1.scala index 4a76d45597eb..26090c0adcb7 100644 --- a/tests/run-macros/i4515/Macro_1.scala +++ b/tests/run-macros/i4515/Macro_1.scala @@ -1,5 +1,5 @@ import scala.quoted._ object Macro { inline def foo[X](x: X): Unit = ${fooImpl('x)} - def fooImpl[X: quoted.Type](x: Expr[X])(using QuoteContext): Expr[Unit] = '{} + def fooImpl[X: quoted.Staged](x: Expr[X])(using QuoteContext): Expr[Unit] = '{} } diff --git a/tests/run-macros/i5941/macro_1.scala b/tests/run-macros/i5941/macro_1.scala index 467203dd8957..d42c4aee6454 100644 --- a/tests/run-macros/i5941/macro_1.scala +++ b/tests/run-macros/i5941/macro_1.scala @@ -11,7 +11,7 @@ object Lens { def set(t: T, s: S): S = _set(t)(s) } - def impl[S: Type, T: Type](getter: Expr[S => T])(using qctx: QuoteContext) : Expr[Lens[S, T]] = { + def impl[S: Staged, T: Staged](getter: Expr[S => T])(using qctx: QuoteContext) : Expr[Lens[S, T]] = { import qctx.tasty._ import util._ @@ -84,7 +84,7 @@ object Iso { def to(s: S): A = _to(s) } - def impl[S: Type, A: Type](using qctx: QuoteContext) : Expr[Iso[S, A]] = { + def impl[S: Staged, A: Staged](using qctx: QuoteContext) : Expr[Iso[S, A]] = { import qctx.tasty._ import util._ @@ -123,7 +123,7 @@ object Iso { } } - def implUnit[S: Type](using qctx: QuoteContext) : Expr[Iso[S, 1]] = { + def implUnit[S: Staged](using qctx: QuoteContext) : Expr[Iso[S, 1]] = { import qctx.tasty._ import util._ @@ -160,7 +160,7 @@ object Iso { } // TODO: require whitebox macro - def implFields[S: Type](using qctx: QuoteContext) : Expr[Iso[S, Any]] = ??? + def implFields[S: Staged](using qctx: QuoteContext) : Expr[Iso[S, Any]] = ??? } object GenIso { @@ -195,7 +195,7 @@ object Prism { def apply(a: A): S = app(a) } - def impl[S: Type, A <: S : Type](using qctx: QuoteContext) : Expr[Prism[S, A]] = { + def impl[S: Staged, A <: S : Staged](using qctx: QuoteContext) : Expr[Prism[S, A]] = { import qctx.tasty._ import util._ diff --git a/tests/run-macros/i6679/Macro_1.scala b/tests/run-macros/i6679/Macro_1.scala index efc79c82c4fd..24ea5a3a367f 100644 --- a/tests/run-macros/i6679/Macro_1.scala +++ b/tests/run-macros/i6679/Macro_1.scala @@ -1,6 +1,6 @@ import scala.quoted._ -def makeMatch[A: Type](head : Expr[A])(using qctx : QuoteContext) : Expr[Unit] = { +def makeMatch[A: Staged](head : Expr[A])(using qctx : QuoteContext) : Expr[Unit] = { import qctx.tasty._ val sacrifice = '{ $head match { case _ => ??? } } diff --git a/tests/run-macros/i6772/Macro_1.scala b/tests/run-macros/i6772/Macro_1.scala index cb8952618d43..8bf58f1a323d 100644 --- a/tests/run-macros/i6772/Macro_1.scala +++ b/tests/run-macros/i6772/Macro_1.scala @@ -7,7 +7,7 @@ object Macros { def mImpl()(using QuoteContext): Expr[Any] = List(Expr(1), Expr(2), Expr(3)).toExprOfList - extension [T](list: List[Expr[T]]) def toExprOfList(using Type[T], QuoteContext): Expr[List[T]] = '{ + extension [T](list: List[Expr[T]]) def toExprOfList(using Staged[T], QuoteContext): Expr[List[T]] = '{ val buff = List.newBuilder[T] ${ Expr.block(list.map(v => '{ buff += $v }), '{ buff.result() }) } } diff --git a/tests/run-macros/i7008/macro_1.scala b/tests/run-macros/i7008/macro_1.scala index a7946261b144..63a1326195d3 100644 --- a/tests/run-macros/i7008/macro_1.scala +++ b/tests/run-macros/i7008/macro_1.scala @@ -10,7 +10,7 @@ def mcrProxy(expr: Expr[Boolean])(using QuoteContext): Expr[Unit] = { res } -def mcrImpl[T](func: Expr[Seq[Box[T]] => Unit], expr: Expr[T])(using ctx: QuoteContext, tt: Type[T]): Expr[Unit] = { +def mcrImpl[T](func: Expr[Seq[Box[T]] => Unit], expr: Expr[T])(using ctx: QuoteContext, tt: Staged[T]): Expr[Unit] = { import ctx.tasty._ val arg = Varargs(Seq('{(Box($expr))})) Expr.betaReduce(func)(arg) diff --git a/tests/run-macros/i7048/Lib_1.scala b/tests/run-macros/i7048/Lib_1.scala index b2b0fc70f6c8..cb7b604b15cd 100644 --- a/tests/run-macros/i7048/Lib_1.scala +++ b/tests/run-macros/i7048/Lib_1.scala @@ -12,7 +12,7 @@ given [U] as IsExpr[Expr[U]] = new IsExpr[Expr[U]] { def f(x: Any): String = x.toString -def g[T](x: T)(using e: IsExpr[T])(using tu: Type[e.Underlying]): QuoteContext ?=> Expr[String] = { +def g[T](x: T)(using e: IsExpr[T])(using tu: Staged[e.Underlying]): QuoteContext ?=> Expr[String] = { val underlying: Expr[e.Underlying] = e.toExpr(x) '{f($underlying)} } diff --git a/tests/run-macros/i7519c/Macro_1.scala b/tests/run-macros/i7519c/Macro_1.scala index 415500ef17c3..8d30a9ae1f7c 100644 --- a/tests/run-macros/i7519c/Macro_1.scala +++ b/tests/run-macros/i7519c/Macro_1.scala @@ -7,7 +7,7 @@ class Quoted[T] inline def quote[T]: String = ${ quoteImpl[T] } -def quoteImpl[T: Type](using qctx: QuoteContext): Expr[String] = { +def quoteImpl[T: Staged](using qctx: QuoteContext): Expr[String] = { val value: Expr[Int] = '{ 42 } Expr(('{ new Quoted[T @Annot($value)] }).show) } diff --git a/tests/run-macros/i7887/Macro_1.scala b/tests/run-macros/i7887/Macro_1.scala index 74349c8364cb..6116f9e8abb3 100644 --- a/tests/run-macros/i7887/Macro_1.scala +++ b/tests/run-macros/i7887/Macro_1.scala @@ -1,7 +1,7 @@ def myMacroImpl(a: quoted.Expr[_])(using qctx: quoted.QuoteContext) = { import qctx.tasty._ def typed[A] = { - implicit val t: quoted.Type[A] = a.unseal.tpe.widen.seal.asInstanceOf[quoted.Type[A]] + implicit val t: quoted.Staged[A] = a.unseal.tpe.widen.seal.asInstanceOf[quoted.Staged[A]] '{ type T = $t ${a.unseal.seal.cast[T]} diff --git a/tests/run-macros/i8007/Macro_1.scala b/tests/run-macros/i8007/Macro_1.scala index 585220172e40..b904039309b0 100644 --- a/tests/run-macros/i8007/Macro_1.scala +++ b/tests/run-macros/i8007/Macro_1.scala @@ -4,7 +4,7 @@ import scala.quoted._ object Macro1 { - def mirrorFields[T](t: Type[T])(using qctx: QuoteContext): List[String] = + def mirrorFields[T](t: Staged[T])(using qctx: QuoteContext): List[String] = t match { case '[$field *: $fields] => field.show :: mirrorFields(fields) case '[EmptyTuple] => Nil @@ -16,7 +16,7 @@ object Macro1 { inline def test1[T](value: =>T): List[String] = ${ test1Impl('value) } - def test1Impl[T: Type](value: Expr[T])(using qctx: QuoteContext): Expr[List[String]] = { + def test1Impl[T: Staged](value: Expr[T])(using qctx: QuoteContext): Expr[List[String]] = { import qctx.tasty._ val mirrorTpe = '[Mirror.Of[T]] diff --git a/tests/run-macros/i8007/Macro_2.scala b/tests/run-macros/i8007/Macro_2.scala index ee5b0a142324..a85c7139c78b 100644 --- a/tests/run-macros/i8007/Macro_2.scala +++ b/tests/run-macros/i8007/Macro_2.scala @@ -4,7 +4,7 @@ import scala.quoted._ object Macro2 { - def mirrorFields[T](t: Type[T])(using qctx: QuoteContext): List[String] = + def mirrorFields[T](t: Staged[T])(using qctx: QuoteContext): List[String] = t match { case '[$field *: $fields] => field.show.substring(1, field.show.length-1) :: mirrorFields(fields) case '[EmptyTuple] => Nil @@ -20,7 +20,7 @@ object Macro2 { def encode(elem: T): String = body(elem) } - def derived[T: Type](ev: Expr[Mirror.Of[T]])(using qctx: QuoteContext): Expr[JsonEncoder[T]] = { + def derived[T: Staged](ev: Expr[Mirror.Of[T]])(using qctx: QuoteContext): Expr[JsonEncoder[T]] = { import qctx.tasty._ val fields = ev match { @@ -42,7 +42,7 @@ object Macro2 { inline def test2[T](value: =>T): Unit = ${ test2Impl('value) } - def test2Impl[T: Type](value: Expr[T])(using qctx: QuoteContext): Expr[Unit] = { + def test2Impl[T: Staged](value: Expr[T])(using qctx: QuoteContext): Expr[Unit] = { import qctx.tasty._ val mirrorTpe = '[Mirror.Of[T]] diff --git a/tests/run-macros/i8007/Macro_3.scala b/tests/run-macros/i8007/Macro_3.scala index a6e54a2bfc03..d6dcb2df6e90 100644 --- a/tests/run-macros/i8007/Macro_3.scala +++ b/tests/run-macros/i8007/Macro_3.scala @@ -25,14 +25,14 @@ object Eq { def eqv(x: T, y: T): Boolean = body(x, y) } - def summonAll[T](t: Type[T])(using qctx: QuoteContext): List[Expr[Eq[_]]] = t match { + def summonAll[T](t: Staged[T])(using qctx: QuoteContext): List[Expr[Eq[_]]] = t match { case '[String *: $tpes] => '{ summon[Eq[String]] } :: summonAll(tpes) case '[Int *: $tpes] => '{ summon[Eq[Int]] } :: summonAll(tpes) case '[$tpe *: $tpes] => derived(using tpe, qctx) :: summonAll(tpes) case '[EmptyTuple] => Nil } - given derived[T: Type](using qctx: QuoteContext) as Expr[Eq[T]] = { + given derived[T: Staged](using qctx: QuoteContext) as Expr[Eq[T]] = { import qctx.tasty._ val ev: Expr[Mirror.Of[T]] = Expr.summon(using '[Mirror.Of[T]]).get diff --git a/tests/run-macros/i8520/Macro_1.scala b/tests/run-macros/i8520/Macro_1.scala index 7ad9e353bb35..8842f26698b0 100644 --- a/tests/run-macros/i8520/Macro_1.scala +++ b/tests/run-macros/i8520/Macro_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ inline def test[T[_]]: Unit = ${ testExpr[T] } -def testExpr[T[_]: Type](using QuoteContext): Expr[Unit] = { +def testExpr[T[_]: Staged](using QuoteContext): Expr[Unit] = { import qctx.tasty._ def variance(f: Flags) = if f.is(Flags.Covariant) then "+" diff --git a/tests/run-macros/i9206/Macros_1.scala b/tests/run-macros/i9206/Macros_1.scala index 9d512f46c02f..d65ef5c2a836 100644 --- a/tests/run-macros/i9206/Macros_1.scala +++ b/tests/run-macros/i9206/Macros_1.scala @@ -4,8 +4,8 @@ import scala.quoted.{Expr, QuoteContext} object Inspect { inline def inspect[T <: AnyKind]: String = ${ inspectTpe[T] } - def inspectTpe[T <: AnyKind](using tpe: quoted.Type[T], qctx0: QuoteContext): Expr[String] = { - val tree = summon[quoted.Type[T]].unseal.tpe.typeSymbol.tree + def inspectTpe[T <: AnyKind](using tpe: quoted.Staged[T], qctx0: QuoteContext): Expr[String] = { + val tree = summon[quoted.Staged[T]].unseal.tpe.typeSymbol.tree Expr(tree.show) } } 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 f745abe2a30e..3339a5b37d35 100644 --- a/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala +++ b/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala @@ -6,10 +6,10 @@ object E { inline def eval[T](inline x: E[T]): T = ${ impl('x) } - def impl[T: Type](expr: Expr[E[T]]) (using QuoteContext): Expr[T] = + def impl[T: Staged](expr: Expr[E[T]]) (using QuoteContext): Expr[T] = expr.unliftOrError.lift - implicit def ev1[T: Type]: Unliftable[E[T]] = new Unliftable { // TODO use type class derivation + implicit def ev1[T: Staged]: Unliftable[E[T]] = new Unliftable { // TODO use type class derivation def apply(x: Expr[E[T]]) (using QuoteContext): Option[E[T]] = (x match { case '{ I(${Const(n)}) } => Some(I(n)) case '{ D(${Const(n)}) } => Some(D(n)) diff --git a/tests/run-macros/no-symbol/1.scala b/tests/run-macros/no-symbol/1.scala index c8c39f81dafa..cd95598a65a4 100644 --- a/tests/run-macros/no-symbol/1.scala +++ b/tests/run-macros/no-symbol/1.scala @@ -8,7 +8,7 @@ object Macro { inline def foo[T]: String = ${ fooImpl[T] } - def fooImpl[T](implicit t: Type[T], qctx: QuoteContext): Expr[String] = { + def fooImpl[T](implicit t: Staged[T], qctx: QuoteContext): Expr[String] = { import qctx.tasty._ val sym = t.unseal.symbol if sym.isClassDef then '{ "symbol" } diff --git a/tests/run-macros/quote-implicitMatch/Macro_1.scala b/tests/run-macros/quote-implicitMatch/Macro_1.scala index bf4f779b5a69..bb0718c2c928 100644 --- a/tests/run-macros/quote-implicitMatch/Macro_1.scala +++ b/tests/run-macros/quote-implicitMatch/Macro_1.scala @@ -5,7 +5,7 @@ import scala.quoted._ inline def f1[T]() = ${ f1Impl[T] } -def f1Impl[T: Type](using QuoteContext) = { +def f1Impl[T: Staged](using QuoteContext) = { Expr.summon[Ordering[T]] match { case Some(ord) => '{ new TreeSet[T]()($ord) } case _ => '{ new HashSet[T] } diff --git a/tests/run-macros/quote-impure-by-name/quoted_1.scala b/tests/run-macros/quote-impure-by-name/quoted_1.scala index 5f0dc8550e8e..5fd0804cbb76 100644 --- a/tests/run-macros/quote-impure-by-name/quoted_1.scala +++ b/tests/run-macros/quote-impure-by-name/quoted_1.scala @@ -10,7 +10,7 @@ object Index { implicit inline def succ[K, H, T](implicit inline prev: Index[K, T]): Index[K, (H, T)] = ${ succImpl[K, H, T]('prev) } - def succImpl[K: Type, H: Type, T: Type](prev: Expr[Index[K, T]])(using QuoteContext): Expr[Index[K, (H, T)]] = { + def succImpl[K: Staged, H: Staged, T: Staged](prev: Expr[Index[K, T]])(using QuoteContext): Expr[Index[K, (H, T)]] = { val value = s"1 + {${prev.show}}" '{new Index(${Expr(value)})} } diff --git a/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala b/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala index bb89353a23c0..a49bbe7f4608 100644 --- a/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala +++ b/tests/run-macros/quote-indexed-map-by-name/quoted_1.scala @@ -7,10 +7,10 @@ object Index { implicit inline def succ[K, H, T](implicit prev: => Index[K, T]): Index[K, (H, T)] = ${succImpl('[K], '[H], '[T])} - def succImpl[K, H, T](k: Type[K], h: Type[H], t: Type[T])(using QuoteContext): Expr[Index[K, (H, T)]] = { - implicit val kk: Type[K] = k - implicit val hh: Type[H] = h - implicit val tt: Type[T] = t + def succImpl[K, H, T](k: Staged[K], h: Staged[H], t: Staged[T])(using QuoteContext): Expr[Index[K, (H, T)]] = { + implicit val kk: Staged[K] = k + implicit val hh: Staged[H] = h + implicit val tt: Staged[T] = t '{new Index(0)} } } diff --git a/tests/run-macros/quote-matcher-runtime/quoted_1.scala b/tests/run-macros/quote-matcher-runtime/quoted_1.scala index 543b002ce429..895c3a81f0ad 100644 --- a/tests/run-macros/quote-matcher-runtime/quoted_1.scala +++ b/tests/run-macros/quote-matcher-runtime/quoted_1.scala @@ -11,7 +11,7 @@ object Macros { tup.toArray.toList.map { case r: Expr[_] => s"Expr(${r.unseal.show})" - case r: quoted.Type[_] => + case r: quoted.Staged[_] => s"Type(${r.unseal.show})" case r: String => s"String($r)" 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 4bc796909386..3c39b614498f 100644 --- a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala @@ -6,7 +6,7 @@ object Macros { inline def lift[T](sym: Symantics[T])(inline a: DSL): T = ${impl[T]('sym, 'a)} - private def impl[T: Type](sym: Expr[Symantics[T]], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = { + private def impl[T: Staged](sym: Expr[Symantics[T]], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = { def lift(e: Expr[DSL]): Expr[T] = e match { 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 239a33bd4a7c..60c8824a5478 100644 --- a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala @@ -10,7 +10,7 @@ object Macros { inline def liftAST(inline a: DSL): ASTNum = ${impl(ASTNum, 'a)} - private def impl[T: Type](sym: Symantics[T], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = { + private def impl[T: Staged](sym: Symantics[T], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = { def lift(e: Expr[DSL])(implicit env: Map[Int, Expr[T]]): Expr[T] = e match { 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 33984a6ef4dc..67a11d9df1b5 100644 --- a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala @@ -8,7 +8,7 @@ object Macros { inline def lift[R[_]](sym: Symantics { type Repr[X] = R[X] })(inline a: Int): R[Int] = ${impl('sym, 'a)} - private def impl[R[_]: Type](sym: Expr[Symantics { type Repr[X] = R[X] }], expr: Expr[Int])(using QuoteContext): Expr[R[Int]] = { + private def impl[R[_]: Staged](sym: Expr[Symantics { type Repr[X] = R[X] }], expr: Expr[Int])(using QuoteContext): Expr[R[Int]] = { type Env = Map[Int, Any] @@ -26,7 +26,7 @@ object Macros { None } - def lift[T: Type](e: Expr[T])(using env: Env): Expr[R[T]] = ((e: Expr[Any]) match { + def lift[T: Staged](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]] } @@ -76,7 +76,7 @@ object Macros { } -def freshEnvVar[T: Type]()(using QuoteContext): (Int, Expr[T]) = { +def freshEnvVar[T: Staged]()(using QuoteContext): (Int, Expr[T]) = { v += 1 (v, '{envVar[T](${Expr(v)})}) } diff --git a/tests/run-macros/quote-matching-optimize-1/Macro_1.scala b/tests/run-macros/quote-matching-optimize-1/Macro_1.scala index 6946776cb94e..773a3c65f90b 100644 --- a/tests/run-macros/quote-matching-optimize-1/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-1/Macro_1.scala @@ -4,7 +4,7 @@ object Macro { inline def optimize[T](inline x: T): Any = ${ Macro.impl('x) } - def impl[T: Type](x: Expr[T])(using QuoteContext): Expr[Any] = { + def impl[T: Staged](x: Expr[T])(using QuoteContext): Expr[Any] = { def optimize(x: Expr[Any]): Expr[Any] = x match { case '{ type $t; ($ls: List[`$t`]).filter($f).filter($g) } => diff --git a/tests/run-macros/quote-matching-optimize-2/Macro_1.scala b/tests/run-macros/quote-matching-optimize-2/Macro_1.scala index c891c09ed539..f358160a395b 100644 --- a/tests/run-macros/quote-matching-optimize-2/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-2/Macro_1.scala @@ -4,7 +4,7 @@ object Macro { inline def optimize[T](inline x: T): Any = ${ Macro.impl('x) } - def impl[T: Type](x: Expr[T])(using QuoteContext): Expr[Any] = { + def impl[T: Staged](x: Expr[T])(using QuoteContext): Expr[Any] = { def optimize(x: Expr[Any]): Expr[Any] = x match { case '{ ($ls: List[$t]).filter($f).filter($g) } => diff --git a/tests/run-macros/quote-matching-optimize-3/Macro_1.scala b/tests/run-macros/quote-matching-optimize-3/Macro_1.scala index 4628d8019d48..ece3557e580a 100644 --- a/tests/run-macros/quote-matching-optimize-3/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-3/Macro_1.scala @@ -4,7 +4,7 @@ object Macro { inline def optimize[T](inline x: T): Any = ${ Macro.impl('x) } - def impl[T: Type](x: Expr[T])(using QuoteContext): Expr[Any] = { + def impl[T: Staged](x: Expr[T])(using QuoteContext): Expr[Any] = { def optimize(x: Expr[Any]): Expr[Any] = x match { case '{ ($ls: List[$t]).filter($f).filter($g) } => diff --git a/tests/run-macros/quote-toExprOfTuple/Macro_1.scala b/tests/run-macros/quote-toExprOfTuple/Macro_1.scala index 0f023cbe4e5c..fff12077326d 100644 --- a/tests/run-macros/quote-toExprOfTuple/Macro_1.scala +++ b/tests/run-macros/quote-toExprOfTuple/Macro_1.scala @@ -3,7 +3,7 @@ import scala.quoted._ object Macro { inline def t2[T0, T1](t0: T0, t1: T1): (T0, T1) = ${ impl2('{t0}, '{t1}) } - def impl2[T0: Type, T1: Type](t0: Expr[T0], t1: Expr[T1])(using qctx: QuoteContext) : Expr[(T0, T1)] = { + def impl2[T0: Staged, T1: Staged](t0: Expr[T0], t1: Expr[T1])(using qctx: QuoteContext) : Expr[(T0, T1)] = { import qctx.tasty._ import util._ 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..364b57ba69d6 100644 --- a/tests/run-macros/quote-type-matcher-2/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher-2/quoted_1.scala @@ -4,8 +4,8 @@ object Macros { inline def lift[A]: String = ${ matchesExpr('[A]) } - private def matchesExpr(tp: Type[_])(using QuoteContext): Expr[String] = { - def lift(tp: Type[_]): String = tp match { + private def matchesExpr(tp: Staged[_])(using QuoteContext): Expr[String] = { + def lift(tp: Staged[_]): String = tp match { case '[Int] => "%Int%" case '[List[$t]] => s"%List[${lift(t)}]%" case '[Option[$t]] => s"%Option[${lift(t)}]%" diff --git a/tests/run-macros/quote-type-matcher/quoted_1.scala b/tests/run-macros/quote-type-matcher/quoted_1.scala index 3867d331e7db..331c24d35100 100644 --- a/tests/run-macros/quote-type-matcher/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher/quoted_1.scala @@ -4,12 +4,12 @@ object Macros { inline def matches[A, B]: Unit = ${ matchesExpr('[A], '[B]) } - private def matchesExpr[A, B](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[Unit] = { + private def matchesExpr[A, B](a: Staged[A], b: Staged[B])(using qctx: QuoteContext) : Expr[Unit] = { import qctx.tasty._ val res = scala.internal.quoted.Type.unapply[Tuple, Tuple](a)(using b, true, qctx).map { tup => tup.toArray.toList.map { - case r: quoted.Type[_] => + case r: quoted.Type => s"Type(${r.unseal.show})" case r: String => s"String($r)" diff --git a/tests/run-macros/quoted-pattern-type/Macro_1.scala b/tests/run-macros/quoted-pattern-type/Macro_1.scala index 7fa9cf6b587f..73ac186d2b8c 100644 --- a/tests/run-macros/quoted-pattern-type/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-type/Macro_1.scala @@ -4,7 +4,7 @@ object Lib { inline def foo[T](inline arg: T): T = ${ impl('arg) } - private def impl[T: Type](arg: Expr[T])(using QuoteContext): Expr[T] = { + private def impl[T: Staged](arg: Expr[T])(using QuoteContext): Expr[T] = { arg match { case e @ '{ $x: Boolean } => '{ println("Boolean: " + $e); $e } case e @ '{ $x: Int } => '{ println("Int: " + $x); $x } diff --git a/tests/run-macros/refined-selectable-macro/Macro_1.scala b/tests/run-macros/refined-selectable-macro/Macro_1.scala index e97e6b50abe5..9dccac93cb77 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_1.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_1.scala @@ -48,7 +48,7 @@ object Macro { Expr.ofTupleFromSeq(ret) } - private def fromTupleImpl[T: Type](s: Expr[Tuple], newRecord: Expr[Array[(String, Any)] => T])(using qctx:QuoteContext) : Expr[Any] = { + private def fromTupleImpl[T: Staged](s: Expr[Tuple], newRecord: Expr[Array[(String, Any)] => T])(using qctx:QuoteContext) : Expr[Any] = { import qctx.tasty._ val repr = s.unseal.tpe.widenTermRefExpr.dealias diff --git a/tests/run-macros/refined-selectable-macro/Macro_2.scala b/tests/run-macros/refined-selectable-macro/Macro_2.scala index cccfcc74e44c..6186d37984f7 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_2.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_2.scala @@ -16,7 +16,7 @@ object Macro2 { inline def apply[R <: Record](elems: (String, Any)*) : R = ${ applyImpl('elems, '[R]) } - def applyImpl[R <: Record: Type](elems: Expr[Seq[(String, Any)]], ev: Type[R])(using qctx: QuoteContext) = { + def applyImpl[R <: Record: Staged](elems: Expr[Seq[(String, Any)]], ev: Staged[R])(using qctx: QuoteContext) = { '{ new Record($elems:_*).asInstanceOf[$ev] } } diff --git a/tests/run-macros/tasty-dealias/quoted_1.scala b/tests/run-macros/tasty-dealias/quoted_1.scala index a0c99aed1c7d..171780384258 100644 --- a/tests/run-macros/tasty-dealias/quoted_1.scala +++ b/tests/run-macros/tasty-dealias/quoted_1.scala @@ -4,7 +4,7 @@ object Macros { inline def dealias[T]: String = ${ impl('[T]) } - def impl[T](x: quoted.Type[T])(using qctx: QuoteContext) : Expr[String] = { + def impl[T](x: quoted.Staged[T])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ Expr(x.unseal.tpe.dealias.show) } diff --git a/tests/run-macros/tasty-extractors-types/quoted_1.scala b/tests/run-macros/tasty-extractors-types/quoted_1.scala index a2b38ba94c60..44b60a9ec9e4 100644 --- a/tests/run-macros/tasty-extractors-types/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-types/quoted_1.scala @@ -4,7 +4,7 @@ object Macros { implicit inline def printType[T]: Unit = ${ impl('[T]) } - def impl[T](x: Type[T])(using qctx: QuoteContext) : Expr[Unit] = { + def impl[T](x: Staged[T])(using qctx: QuoteContext) : Expr[Unit] = { import qctx.tasty._ val tree = x.unseal diff --git a/tests/run-macros/tasty-indexed-map/quoted_1.scala b/tests/run-macros/tasty-indexed-map/quoted_1.scala index 1a40645d3ffc..2b68c8549952 100644 --- a/tests/run-macros/tasty-indexed-map/quoted_1.scala +++ b/tests/run-macros/tasty-indexed-map/quoted_1.scala @@ -24,7 +24,7 @@ object Index { implicit inline def succ[K, H, T](implicit prev: => Index[K, T]): Index[K, (H, T)] = ${succImpl[K, H, T]} - def succImpl[K, H, T](implicit qctx: QuoteContext, k: Type[K], h: Type[H], t: Type[T]): Expr[Index[K, (H, T)]] = { + def succImpl[K, H, T](implicit qctx: QuoteContext, k: Staged[K], h: Staged[H], t: Staged[T]): Expr[Index[K, (H, T)]] = { import qctx.tasty._ def name(tp: TypeOrBounds): String = tp match { diff --git a/tests/run-macros/tasty-linenumber/quoted_1.scala b/tests/run-macros/tasty-linenumber/quoted_1.scala index 8a71191cd815..839f9c8ebe6a 100644 --- a/tests/run-macros/tasty-linenumber/quoted_1.scala +++ b/tests/run-macros/tasty-linenumber/quoted_1.scala @@ -9,7 +9,7 @@ object LineNumber { implicit inline def line[T >: Unit <: Unit]: LineNumber = ${lineImpl('[T])} - def lineImpl(x: Type[Unit])(using QuoteContext) : Expr[LineNumber] = { + def lineImpl(x: Staged[Unit])(using QuoteContext) : Expr[LineNumber] = { import qctx.tasty._ '{new LineNumber(${Expr(rootPosition.startLine)})} } diff --git a/tests/run-macros/tasty-macro-positions/quoted_1.scala b/tests/run-macros/tasty-macro-positions/quoted_1.scala index bc94ec971729..4c69b35429e1 100644 --- a/tests/run-macros/tasty-macro-positions/quoted_1.scala +++ b/tests/run-macros/tasty-macro-positions/quoted_1.scala @@ -8,7 +8,7 @@ object Macros { inline def fun3[T]: Unit = ${ impl2('[T]) } - def impl(x: Expr[Any])(using qctx: QuoteContext) : Expr[Unit] = { + def impl(x: Expr[Any])(using qctx: QuoteContext): Expr[Unit] = { import qctx.tasty._ val pos = x.unseal.underlyingArgument.pos val code = x.unseal.underlyingArgument.show @@ -18,7 +18,7 @@ object Macros { } } - def impl2[T](x: quoted.Type[T])(using qctx: QuoteContext) : Expr[Unit] = { + def impl2[T](x: Staged[T])(using qctx: QuoteContext): Expr[Unit] = { import qctx.tasty._ val pos = x.unseal.pos val code = x.unseal.show diff --git a/tests/run-macros/tasty-positioned/quoted_1.scala b/tests/run-macros/tasty-positioned/quoted_1.scala index 04ad5c316e65..40468baf3fc3 100644 --- a/tests/run-macros/tasty-positioned/quoted_1.scala +++ b/tests/run-macros/tasty-positioned/quoted_1.scala @@ -9,7 +9,7 @@ object Positioned { implicit inline def apply[T](x: => T): Positioned[T] = ${impl('x)} - def impl[T](x: Expr[T])(implicit ev: Type[T], qctx: QuoteContext): Expr[Positioned[T]] = { + def impl[T](x: Expr[T])(implicit ev: Staged[T], qctx: QuoteContext): Expr[Positioned[T]] = { import qctx.tasty.{Position => _, _} val pos = rootPosition diff --git a/tests/run-macros/tasty-simplified/quoted_1.scala b/tests/run-macros/tasty-simplified/quoted_1.scala index c9ef9a10dd43..d5ab6b5acdba 100644 --- a/tests/run-macros/tasty-simplified/quoted_1.scala +++ b/tests/run-macros/tasty-simplified/quoted_1.scala @@ -5,7 +5,7 @@ object Macros { inline def simplified[T <: Tuple]: Seq[String] = ${ impl[T] } - def impl[T: Type](using qctx: QuoteContext) : Expr[Seq[String]] = { + def impl[T: Staged](using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.tasty._ def unpackTuple(tp: Type): List[Type] = { diff --git a/tests/run-macros/tasty-subtyping/quoted_1.scala b/tests/run-macros/tasty-subtyping/quoted_1.scala index c077d1a457ac..d4c2ad4acbfa 100644 --- a/tests/run-macros/tasty-subtyping/quoted_1.scala +++ b/tests/run-macros/tasty-subtyping/quoted_1.scala @@ -8,13 +8,13 @@ object Macros { inline def isSubTypeOf[T, U]: Boolean = ${isSubTypeOfImpl('[T], '[U])} - def isTypeEqualImpl[T, U](t: Type[T], u: Type[U])(using QuoteContext) : Expr[Boolean] = { + def isTypeEqualImpl[T, U](t: Staged[T], u: Staged[U])(using QuoteContext) : Expr[Boolean] = { import qctx.tasty._ val isTypeEqual = t.unseal.tpe =:= u.unseal.tpe Expr(isTypeEqual) } - def isSubTypeOfImpl[T, U](t: Type[T], u: Type[U])(using QuoteContext) : Expr[Boolean] = { + def isSubTypeOfImpl[T, U](t: Staged[T], u: Staged[U])(using QuoteContext) : Expr[Boolean] = { import qctx.tasty._ val isTypeEqual = t.unseal.tpe <:< u.unseal.tpe Expr(isTypeEqual) diff --git a/tests/run-macros/tasty-tree-map/quoted_1.scala b/tests/run-macros/tasty-tree-map/quoted_1.scala index de2381cae8cd..34cb42af5391 100644 --- a/tests/run-macros/tasty-tree-map/quoted_1.scala +++ b/tests/run-macros/tasty-tree-map/quoted_1.scala @@ -4,7 +4,7 @@ object Macros { implicit inline def identityMaped[T](x: => T): T = ${ impl('x) } - def impl[T: Type](x: Expr[T])(using qctx: QuoteContext) : Expr[T] = { + def impl[T: Staged](x: Expr[T])(using qctx: QuoteContext) : Expr[T] = { import qctx.tasty.{_, given _} // FIXME: #8919 val identityMap = new TreeMap { } val transformed = identityMap.transformTerm(x.unseal).seal.cast[T] diff --git a/tests/run-macros/type-show/Macro_1.scala b/tests/run-macros/type-show/Macro_1.scala index 6f35fcbe6348..9e4192be7d1b 100644 --- a/tests/run-macros/type-show/Macro_1.scala +++ b/tests/run-macros/type-show/Macro_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ object TypeToolbox { inline def show[A]: String = ${ showImpl('[A]) } - private def showImpl[A, B](a: Type[A])(using qctx: QuoteContext) : Expr[String] = { + private def showImpl[A, B](a: Staged[A])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ Expr(a.show) } diff --git a/tests/run-staging/abstract-int-quote.scala b/tests/run-staging/abstract-int-quote.scala index 00411042cbaf..efa8fd2cfe7d 100644 --- a/tests/run-staging/abstract-int-quote.scala +++ b/tests/run-staging/abstract-int-quote.scala @@ -6,7 +6,7 @@ object Test: given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = - def reduce[T: Type](using QuoteContext)(succ: Expr[T] => Expr[T], zero: Expr[T]): Expr[T] = '{ + def reduce[T: Staged](using QuoteContext)(succ: Expr[T] => Expr[T], zero: Expr[T]): Expr[T] = '{ var z = $zero ${ succ('z) } } diff --git a/tests/run-staging/i3823-b.scala b/tests/run-staging/i3823-b.scala index f4f77d3cabf5..46b9711709e0 100644 --- a/tests/run-staging/i3823-b.scala +++ b/tests/run-staging/i3823-b.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuoteContext { - def f[T](x: Expr[T])(implicit t: Type[T]) = '{ + def f[T](x: Expr[T])(implicit t: Staged[T]) = '{ val z: $t = $x } println(f('{2})(Type.IntTag).show) diff --git a/tests/run-staging/i3823-c.scala b/tests/run-staging/i3823-c.scala index 5a6074788840..ccab45a067f9 100644 --- a/tests/run-staging/i3823-c.scala +++ b/tests/run-staging/i3823-c.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuoteContext { - def f[T](x: Expr[T])(implicit t: Type[T]) = '{ + def f[T](x: Expr[T])(implicit t: Staged[T]) = '{ val z = $x } println(f('{2})(Type.IntTag).show) diff --git a/tests/run-staging/i3823.scala b/tests/run-staging/i3823.scala index c9702d3c1269..066957562f56 100644 --- a/tests/run-staging/i3823.scala +++ b/tests/run-staging/i3823.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = withQuoteContext { - def f[T: Type](x: Expr[T])(t: Type[T]) = '{ + def f[T: Staged](x: Expr[T])(t: Staged[T]) = '{ val z: $t = $x } println(f('{2})('[Int]).show) diff --git a/tests/run-staging/i3847-b.scala b/tests/run-staging/i3847-b.scala index 43d75b08949f..f3c8cb2fd092 100644 --- a/tests/run-staging/i3847-b.scala +++ b/tests/run-staging/i3847-b.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ import scala.reflect.ClassTag object Arrays { - implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T], qctx: QuoteContext): Liftable[Array[List[T]]] = { + implicit def ArrayIsLiftable[T: Liftable](implicit t: Staged[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)}) diff --git a/tests/run-staging/i3847.scala b/tests/run-staging/i3847.scala index 2fe1d02d6690..b6ff300b8eea 100644 --- a/tests/run-staging/i3847.scala +++ b/tests/run-staging/i3847.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ import scala.reflect.ClassTag object Arrays { - implicit def ArrayIsLiftable[T: Liftable](implicit t: Type[T], ct: Expr[ClassTag[T]]): Liftable[Array[T]] = { + implicit def ArrayIsLiftable[T: Liftable](implicit t: Staged[T], ct: Expr[ClassTag[T]]): Liftable[Array[T]] = { new Liftable[Array[T]] { def toExpr(arr: Array[T]) = '{ new Array[$t](${Expr(arr.length)})($ct) diff --git a/tests/run-staging/i3947.scala b/tests/run-staging/i3947.scala index 4e65cdcfe2ae..344cec1b6269 100644 --- a/tests/run-staging/i3947.scala +++ b/tests/run-staging/i3947.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947b.scala b/tests/run-staging/i3947b.scala index 68dcd0ea85da..51950d9dcc74 100644 --- a/tests/run-staging/i3947b.scala +++ b/tests/run-staging/i3947b.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println() diff --git a/tests/run-staging/i3947b2.scala b/tests/run-staging/i3947b2.scala index f2959802aec2..805efd79f4fe 100644 --- a/tests/run-staging/i3947b2.scala +++ b/tests/run-staging/i3947b2.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: QuoteContext ?=> java.lang.Class[T]) = { + def test[T: Staged](clazz: QuoteContext ?=> java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println() diff --git a/tests/run-staging/i3947b3.scala b/tests/run-staging/i3947b3.scala index 92a2e89e0628..db9b99bc241e 100644 --- a/tests/run-staging/i3947b3.scala +++ b/tests/run-staging/i3947b3.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947c.scala b/tests/run-staging/i3947c.scala index f63890177c43..03d84ab5906e 100644 --- a/tests/run-staging/i3947c.scala +++ b/tests/run-staging/i3947c.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947d.scala b/tests/run-staging/i3947d.scala index 3b44a5126b3f..6dbf5bf0b93c 100644 --- a/tests/run-staging/i3947d.scala +++ b/tests/run-staging/i3947d.scala @@ -5,7 +5,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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947d2.scala b/tests/run-staging/i3947d2.scala index cc9e2a3839de..42c778570da0 100644 --- a/tests/run-staging/i3947d2.scala +++ b/tests/run-staging/i3947d2.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947e.scala b/tests/run-staging/i3947e.scala index def71f6b51e9..b552ca2d51c1 100644 --- a/tests/run-staging/i3947e.scala +++ b/tests/run-staging/i3947e.scala @@ -7,7 +7,7 @@ object Test { def main(args: Array[String]): Unit = run { - def test[T: Type](clazz: java.lang.Class[T]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947f.scala b/tests/run-staging/i3947f.scala index 048d6d296404..8ee78736c936 100644 --- a/tests/run-staging/i3947f.scala +++ b/tests/run-staging/i3947f.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947g.scala b/tests/run-staging/i3947g.scala index 89d1d32c5c9a..786ae512062d 100644 --- a/tests/run-staging/i3947g.scala +++ b/tests/run-staging/i3947g.scala @@ -5,7 +5,7 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { - def test[T: Type](clazz: java.lang.Class[T]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947i.scala b/tests/run-staging/i3947i.scala index 698b91b8b21b..28f7e78e268c 100644 --- a/tests/run-staging/i3947i.scala +++ b/tests/run-staging/i3947i.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i3947j.scala b/tests/run-staging/i3947j.scala index ea6dae78d9a3..6d9f920e7c8c 100644 --- a/tests/run-staging/i3947j.scala +++ b/tests/run-staging/i3947j.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]) = { + def test[T: Staged](clazz: java.lang.Class[T]) = { val lclazz = Expr(clazz) val name = '{ ($lclazz).getCanonicalName } println(name.show) diff --git a/tests/run-staging/i4044b.scala b/tests/run-staging/i4044b.scala index c23774c5fb02..8cb8cba1727d 100644 --- a/tests/run-staging/i4044b.scala +++ b/tests/run-staging/i4044b.scala @@ -7,7 +7,7 @@ sealed abstract class VarRef[T] { } object VarRef { - def apply[T: Type, U: Type](init: Expr[T])(body: VarRef[T] => Expr[U])(using QuoteContext): Expr[U] = '{ + def apply[T: Staged, U: Staged](init: Expr[T])(body: VarRef[T] => Expr[U])(using QuoteContext): Expr[U] = '{ var x = $init ${body( new VarRef { diff --git a/tests/run-staging/i4044e.scala b/tests/run-staging/i4044e.scala index 331815e1b543..1808c221fbf9 100644 --- a/tests/run-staging/i4044e.scala +++ b/tests/run-staging/i4044e.scala @@ -6,7 +6,7 @@ class Foo { def foo: Unit = withQuoteContext { val e: Expr[Int] = '{3} val f: Expr[Int] = '{5} - val t: Type[Int] = '[Int] + val t: Staged[Int] = '[Int] val q = '{ ${ '{ ($e + $f).asInstanceOf[$t] } } } println(q.show) } diff --git a/tests/run-staging/i4350.scala b/tests/run-staging/i4350.scala index 908a5e63613e..1409a74e860f 100644 --- a/tests/run-staging/i4350.scala +++ b/tests/run-staging/i4350.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.staging._ -class Foo[T: Type] { +class Foo[T: Staged] { def q(using QuoteContext) = '{(null: Any).asInstanceOf[T]} } diff --git a/tests/run-staging/i4591.scala b/tests/run-staging/i4591.scala index c4653c799ebe..72a58c66b9ca 100644 --- a/tests/run-staging/i4591.scala +++ b/tests/run-staging/i4591.scala @@ -3,7 +3,7 @@ import scala.quoted.staging._ object Test { - def foo[T: Type](init: Expr[T])(using QuoteContext): Expr[Unit] = '{ + def foo[T: Staged](init: Expr[T])(using QuoteContext): Expr[Unit] = '{ var x = $init println(x) } diff --git a/tests/run-staging/i5247.scala b/tests/run-staging/i5247.scala index da2a4ee4eae3..5321bc90ffb7 100644 --- a/tests/run-staging/i5247.scala +++ b/tests/run-staging/i5247.scala @@ -7,11 +7,11 @@ object Test { println(foo[Object].show) println(bar[Object].show) } - def foo[H : Type](using QuoteContext): Expr[H] = { + def foo[H : Staged](using QuoteContext): Expr[H] = { val t = '[H] '{ null.asInstanceOf[$t] } } - def bar[H : Type](using QuoteContext): Expr[List[H]] = { + def bar[H : Staged](using QuoteContext): Expr[List[H]] = { val t = '[List[H]] '{ null.asInstanceOf[$t] } } diff --git a/tests/run-staging/i5965.scala b/tests/run-staging/i5965.scala index 5d5f15b17a77..9e2f9b94e84a 100644 --- a/tests/run-staging/i5965.scala +++ b/tests/run-staging/i5965.scala @@ -20,7 +20,7 @@ object Test { println(run(map)) } - def bound[T: Type, S[_]: Type](x: Expr[S[T]])(using QuoteContext): Expr[S[T]] = '{ + def bound[T: Staged, S[_]: Staged](x: Expr[S[T]])(using QuoteContext): Expr[S[T]] = '{ val y: S[T] = $x y } diff --git a/tests/run-staging/i5965b.scala b/tests/run-staging/i5965b.scala index 8850619b912c..6e3db8bed0fa 100644 --- a/tests/run-staging/i5965b.scala +++ b/tests/run-staging/i5965b.scala @@ -20,7 +20,7 @@ object Test { println(run(map)) } - def bound[T: Type, S[_]: Type](x: Expr[S[T]])(using QuoteContext): Expr[S[T]] = '{ + def bound[T: Staged, S[_]: Staged](x: Expr[S[T]])(using QuoteContext): Expr[S[T]] = '{ val y = $x y } diff --git a/tests/run-staging/i6263.scala b/tests/run-staging/i6263.scala index 2c4706853daa..75cfa745aa81 100644 --- a/tests/run-staging/i6263.scala +++ b/tests/run-staging/i6263.scala @@ -12,7 +12,7 @@ object Test { fn(1) } - def fn[T : Type](v : T) = "ok" + def fn[T : Staged](v : T) = "ok" } object O diff --git a/tests/run-staging/i6281.scala b/tests/run-staging/i6281.scala index e390a09aa9e7..e6756be3d5a8 100644 --- a/tests/run-staging/i6281.scala +++ b/tests/run-staging/i6281.scala @@ -18,17 +18,17 @@ object Test extends App { } trait Effects[L <: HList] { - def reify[A](using Type[A]): STM[A, L] => Expr[Stm[A, L]] - def reflect[A](using Type[A]): Expr[Stm[A, L]] => STM[A, L] + def reify[A](using Staged[A]): STM[A, L] => Expr[Stm[A, L]] + def reflect[A](using Staged[A]): Expr[Stm[A, L]] => STM[A, L] } given empty as Effects[HNil] { - def reify[A](using Type[A]) = m => m - def reflect[A](using Type[A]) = m => m + def reify[A](using Staged[A]) = m => m + def reflect[A](using Staged[A]) = m => m } // for reify, we need type tags for E and also strangely for L. - implicit def cons [E, L <: HList](using Effects[L])(using Type[E])(using Type[L])(using QuoteContext): Effects[E :: L] = new Effects[E :: L] { - def reify[A](using Type[A]) = m => '{ k => ${ Effects[L].reify[E] { m( a => Effects[L].reflect[E](Expr.betaReduce('k)(a))) } }} - def reflect[A](using Type[A]) = m => k => Effects[L].reflect[E] { Expr.betaReduce(m)('{ a => ${ Effects[L].reify[E]( k('a)) } })} + implicit def cons [E, L <: HList](using Effects[L])(using Staged[E])(using Staged[L])(using QuoteContext): Effects[E :: L] = new Effects[E :: L] { + def reify[A](using Staged[A]) = m => '{ k => ${ Effects[L].reify[E] { m( a => Effects[L].reflect[E](Expr.betaReduce('k)(a))) } }} + def reflect[A](using Staged[A]) = m => k => Effects[L].reflect[E] { Expr.betaReduce(m)('{ a => ${ Effects[L].reify[E]( k('a)) } })} } def Effects[L <: HList](using Effects[L]): Effects[L] = summon[Effects[L]] diff --git a/tests/run-staging/quote-lib.scala b/tests/run-staging/quote-lib.scala index d1c3016669a0..fb27d8f31757 100644 --- a/tests/run-staging/quote-lib.scala +++ b/tests/run-staging/quote-lib.scala @@ -127,11 +127,11 @@ package liftable { } object Lets { - def letVal[T, U: Type](expr: Expr[T])(body: Expr[T] => Expr[U])(implicit t: Type[T], qctx: QuoteContext): Expr[U] = + def letVal[T, U: Staged](expr: Expr[T])(body: Expr[T] => Expr[U])(implicit t: Staged[T], qctx: QuoteContext): Expr[U] = '{ val letVal: $t = $expr; ${ body('letVal) } } - def letLazyVal[T, U: Type](expr: Expr[T])(body: Expr[T] => Expr[U])(implicit t: Type[T], qctx: QuoteContext): Expr[U] = + def letLazyVal[T, U: Staged](expr: Expr[T])(body: Expr[T] => Expr[U])(implicit t: Staged[T], qctx: QuoteContext): Expr[U] = '{ lazy val letLazyVal: $t = $expr; ${ body('letLazyVal) } } - def letDef[T, U: Type](expr: Expr[T])(body: Expr[T] => Expr[U])(implicit t: Type[T], qctx: QuoteContext): Expr[U] = + def letDef[T, U: Staged](expr: Expr[T])(body: Expr[T] => Expr[U])(implicit t: Staged[T], qctx: QuoteContext): Expr[U] = '{ def letDef: $t = $expr; ${ body('letDef) } } } @@ -143,15 +143,15 @@ package liftable { object Lists { - implicit class LiftedOps[T: Liftable](list: Expr[List[T]])(implicit t: Type[T]) { - def foldLeft[U](acc: Expr[U])(f: Expr[(U, T) => U])(implicit u: Type[U], qctx: QuoteContext): Expr[U] = + implicit class LiftedOps[T: Liftable](list: Expr[List[T]])(implicit t: Staged[T]) { + def foldLeft[U](acc: Expr[U])(f: Expr[(U, T) => U])(implicit u: Staged[U], qctx: QuoteContext): Expr[U] = '{ ($list).foldLeft[$u]($acc)($f) } def foreach(f: Expr[T => Unit])(using QuoteContext): Expr[Unit] = '{ ($list).foreach($f) } } - implicit class UnrolledOps[T: Liftable](list: List[T])(implicit t: Type[T], qctx: QuoteContext) { - def unrolledFoldLeft[U](acc: Expr[U])(f: Expr[(U, T) => U])(implicit u: Type[U]): Expr[U] = list match { + implicit class UnrolledOps[T: Liftable](list: List[T])(implicit t: Staged[T], qctx: QuoteContext) { + def unrolledFoldLeft[U](acc: Expr[U])(f: Expr[(U, T) => U])(implicit u: Staged[U]): Expr[U] = list match { case x :: xs => xs.unrolledFoldLeft('{ ($f).apply($acc, ${Expr(x)}) })(f) case Nil => acc } diff --git a/tests/run-staging/quote-nested-4.check b/tests/run-staging/quote-nested-4.check index ca8eaa483f2f..0ba4de03214b 100644 --- a/tests/run-staging/quote-nested-4.check +++ b/tests/run-staging/quote-nested-4.check @@ -1,5 +1,7 @@ ((qctx: scala.quoted.QuoteContext) ?=> { - val t: scala.quoted.Type[scala.Predef.String] = scala.quoted.Type.apply[scala.Predef.String].apply(using qctx) + val t: scala.quoted.Type$package.Staged[scala.Predef.String] = scala.quoted.Type.apply[scala.Predef.String].apply(using qctx) - (t: scala.quoted.Type[scala.Predef.String]) + (t: scala.quoted.Type { + type T >: scala.Predef.String <: scala.Predef.String + }) }) diff --git a/tests/run-staging/quote-owners-2.scala b/tests/run-staging/quote-owners-2.scala index 6bb0935ee1d3..f46738c1467e 100644 --- a/tests/run-staging/quote-owners-2.scala +++ b/tests/run-staging/quote-owners-2.scala @@ -10,7 +10,7 @@ object Test { '{ println($q) } } - def f(t: Type[List[Int]])(using QuoteContext): Expr[Int] = '{ + def f(t: Staged[List[Int]])(using QuoteContext): Expr[Int] = '{ def ff: Int = { val a: $t = { type T = $t @@ -22,5 +22,5 @@ object Test { ff } - def g[T](a: Type[T])(using QuoteContext): Type[List[T]] = '[List[$a]] + def g[T](a: Staged[T])(using QuoteContext): Staged[List[T]] = '[List[$a]] } diff --git a/tests/run-staging/quote-type-tags.scala b/tests/run-staging/quote-type-tags.scala index 3b5cd3dedbe3..1e37b723946d 100644 --- a/tests/run-staging/quote-type-tags.scala +++ b/tests/run-staging/quote-type-tags.scala @@ -4,7 +4,7 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { - def asof[T: Type, U](x: Expr[T], t: Type[U]): Expr[U] = + def asof[T: Staged, U](x: Expr[T], t: Staged[U]): Expr[U] = '{$x.asInstanceOf[$t]} println(asof('{}, '[Unit]).show) diff --git a/tests/run-staging/quote-unrolled-foreach.scala b/tests/run-staging/quote-unrolled-foreach.scala index 3e1c385c35d3..1dca7d1b3030 100644 --- a/tests/run-staging/quote-unrolled-foreach.scala +++ b/tests/run-staging/quote-unrolled-foreach.scala @@ -53,7 +53,7 @@ object Test { } } - def foreach1Tpe1[T](arrRef: Expr[Array[T]], f: Expr[T => Unit])(implicit t: Type[T], qctx: QuoteContext): Expr[Unit] = '{ + def foreach1Tpe1[T](arrRef: Expr[Array[T]], f: Expr[T => Unit])(implicit t: Staged[T], qctx: QuoteContext): Expr[Unit] = '{ val size = ($arrRef).length var i = 0 while (i < size) { @@ -63,7 +63,7 @@ object Test { } } - def foreach1Tpe2[T: Type](arrRef: Expr[Array[T]], f: Expr[T => Unit])(using QuoteContext): Expr[Unit] = '{ + def foreach1Tpe2[T: Staged](arrRef: Expr[Array[T]], f: Expr[T => Unit])(using QuoteContext): Expr[Unit] = '{ val size = ($arrRef).length var i = 0 while (i < size) { diff --git a/tests/run-staging/quote-valueof-list.scala b/tests/run-staging/quote-valueof-list.scala index 84772ed79bc4..1081eebb0de6 100644 --- a/tests/run-staging/quote-valueof-list.scala +++ b/tests/run-staging/quote-valueof-list.scala @@ -24,7 +24,7 @@ object Test { } } - implicit def UnliftableList[T: Unliftable: Type]: Unliftable[List[T]] = new { + implicit def UnliftableList[T: Unliftable: Staged]: Unliftable[List[T]] = new { def apply(xs: Expr[List[T]])(using QuoteContext): Option[List[T]] = (xs: Expr[Any]) match { case '{ ($xs1: List[T]).::($x) } => for { head <- x.unlift; tail <- xs1.unlift } @@ -34,7 +34,7 @@ object Test { } } - implicit def UnliftableOption[T: Unliftable: Type]: Unliftable[Option[T]] = new { + implicit def UnliftableOption[T: Unliftable: Staged]: Unliftable[Option[T]] = new { def apply(expr: Expr[Option[T]])(using QuoteContext): Option[Option[T]] = expr match { case '{ Some[T]($x) } => for (v <- x.unlift) yield Some(v) case '{ None } => Some(None) diff --git a/tests/run-staging/shonan-hmm-simple.scala b/tests/run-staging/shonan-hmm-simple.scala index 01409d8f1f0e..42057afa3f38 100644 --- a/tests/run-staging/shonan-hmm-simple.scala +++ b/tests/run-staging/shonan-hmm-simple.scala @@ -63,7 +63,7 @@ class RingPV[U: Liftable](u: Ring[U], eu: Ring[Expr[U]])(using QuoteContext) ext case class Complex[T](re: T, im: T) object Complex: - implicit def isLiftable[T: Type: Liftable]: Liftable[Complex[T]] = new Liftable[Complex[T]]: + implicit def isLiftable[T: Staged: Liftable]: Liftable[Complex[T]] = new Liftable[Complex[T]]: def toExpr(comp: Complex[T]) = '{Complex(${Expr(comp.re)}, ${Expr(comp.im)})} case class Vec[Idx, T](size: Idx, get: Idx => T): @@ -83,7 +83,7 @@ class StaticVecOps[T] extends VecOps[Int, T]: sum = plus(sum, vec.get(i)) sum -class ExprVecOps[T: Type](using QuoteContext) extends VecOps[Expr[Int], Expr[T]]: +class ExprVecOps[T: Staged](using QuoteContext) extends VecOps[Expr[Int], Expr[T]]: val reduce: ((Expr[T], Expr[T]) => Expr[T], Expr[T], Vec[Expr[Int], Expr[T]]) => Expr[T] = (plus, zero, vec) => '{ var sum = $zero var i = 0 diff --git a/tests/run-staging/shonan-hmm/Complex.scala b/tests/run-staging/shonan-hmm/Complex.scala index 85c3ee76762d..40fa7f64b802 100644 --- a/tests/run-staging/shonan-hmm/Complex.scala +++ b/tests/run-staging/shonan-hmm/Complex.scala @@ -4,7 +4,7 @@ import scala.quoted._ case class Complex[T](re: T, im: T) object Complex { - implicit def complexIsLiftable[T: Type: Liftable]: Liftable[Complex[T]] = new Liftable { + implicit def complexIsLiftable[T: Staged: Liftable]: Liftable[Complex[T]] = new Liftable { def toExpr(c: Complex[T]) = '{ Complex(${Expr(c.re)}, ${Expr(c.im)}) } } diff --git a/tests/run-staging/shonan-hmm/Lifters.scala b/tests/run-staging/shonan-hmm/Lifters.scala index b0eacfb71f44..1a656f2962df 100644 --- a/tests/run-staging/shonan-hmm/Lifters.scala +++ b/tests/run-staging/shonan-hmm/Lifters.scala @@ -5,11 +5,11 @@ import scala.reflect.ClassTag import scala.quoted._ object Lifters { - implicit def LiftedClassTag[T: Type: ClassTag] (using QuoteContext): Expr[ClassTag[T]] = { + implicit def LiftedClassTag[T: Staged: ClassTag] (using QuoteContext): Expr[ClassTag[T]] = { '{ ClassTag(${Expr(summon[ClassTag[T]].runtimeClass.asInstanceOf[Class[T]])}) } } - implicit def ArrayIsLiftable[T : Type: ClassTag](implicit l: Liftable[T]): Liftable[Array[T]] = new Liftable[Array[T]] { + implicit def ArrayIsLiftable[T : Staged: ClassTag](implicit l: Liftable[T]): Liftable[Array[T]] = new Liftable[Array[T]] { def toExpr(x: Array[T]) = '{ val array = new Array[T](${Expr(x.length)})(${implicitly[Expr[ClassTag[T]]]}) ${initArray(x, 'array)} @@ -23,7 +23,7 @@ object Lifters { } } - private def initArray[T : Liftable : Type](arr: Array[T], array: Expr[Array[T]])(using QuoteContext): Expr[Array[T]] = { + private def initArray[T : Liftable : Staged](arr: Array[T], array: Expr[Array[T]])(using QuoteContext): Expr[Array[T]] = { UnrolledExpr.block( arr.zipWithIndex.map { case (x, i) => '{ $array(${Expr(i)}) = ${Expr(x)} } diff --git a/tests/run-staging/shonan-hmm/MVmult.scala b/tests/run-staging/shonan-hmm/MVmult.scala index b6ef09639d56..1073940899c1 100644 --- a/tests/run-staging/shonan-hmm/MVmult.scala +++ b/tests/run-staging/shonan-hmm/MVmult.scala @@ -98,7 +98,7 @@ object MVmult { } } - def initRows[T: Type](a: Array[Array[Int]])(cont: Array[Expr[Array[Int]]] => Expr[T])(using QuoteContext): Expr[T] = { + def initRows[T: Staged](a: Array[Array[Int]])(cont: Array[Expr[Array[Int]]] => Expr[T])(using QuoteContext): Expr[T] = { import Lifters._ def loop(i: Int, acc: List[Expr[Array[Int]]]): Expr[T] = { if (i >= a.length) cont(acc.toArray.reverse) diff --git a/tests/run-staging/shonan-hmm/UnrolledExpr.scala b/tests/run-staging/shonan-hmm/UnrolledExpr.scala index a761496bd948..78435d351671 100644 --- a/tests/run-staging/shonan-hmm/UnrolledExpr.scala +++ b/tests/run-staging/shonan-hmm/UnrolledExpr.scala @@ -8,7 +8,7 @@ object UnrolledExpr { } // TODO support blocks in the compiler to avoid creating trees of blocks? - def block[T: Type](stats: Iterable[Expr[_]], expr: Expr[T])(using QuoteContext): Expr[T] = { + def block[T: Staged](stats: Iterable[Expr[_]], expr: Expr[T])(using QuoteContext): Expr[T] = { def rec(stats: List[Expr[_]]): Expr[T] = stats match { case x :: xs => '{ $x; ${rec(xs)} } case Nil => expr diff --git a/tests/run-staging/shonan-hmm/VecROp.scala b/tests/run-staging/shonan-hmm/VecROp.scala index 14bbe1570c06..8b3a0f1f9252 100644 --- a/tests/run-staging/shonan-hmm/VecROp.scala +++ b/tests/run-staging/shonan-hmm/VecROp.scala @@ -16,7 +16,7 @@ class StaticVecR[T](r: Ring[T]) extends VecSta with VecROp[Int, T, Unit] { override def toString(): String = s"StaticVecR($r)" } -class VecRDyn[T: Type](using QuoteContext) extends VecDyn with VecROp[Expr[Int], Expr[T], Expr[Unit]] { +class VecRDyn[T: Staged](using QuoteContext) extends VecDyn with VecROp[Expr[Int], Expr[T], Expr[Unit]] { def reduce: ((Expr[T], Expr[T]) => Expr[T], Expr[T], Vec[Expr[Int], Expr[T]]) => Expr[T] = { (plus, zero, vec) => '{ var sum = $zero @@ -31,7 +31,7 @@ class VecRDyn[T: Type](using QuoteContext) extends VecDyn with VecROp[Expr[Int], override def toString(): String = s"VecRDyn" } -class VecRStaDim[T: Type](r: Ring[T])(using QuoteContext) extends VecROp[Int, T, Expr[Unit]] { +class VecRStaDim[T: Staged](r: Ring[T])(using QuoteContext) extends VecROp[Int, T, Expr[Unit]] { val M = new StaticVecR[T](r) def reduce: ((T, T) => T, T, Vec[Int, T]) => T = M.reduce val seq: (Expr[Unit], Expr[Unit]) => Expr[Unit] = (e1, e2) => '{ $e1; $e2 } @@ -45,7 +45,7 @@ class VecRStaDim[T: Type](r: Ring[T])(using QuoteContext) extends VecROp[Int, T, override def toString(): String = s"VecRStaDim($r)" } -class VecRStaDyn[T : Type : Liftable](r: Ring[PV[T]])(using QuoteContext) extends VecROp[PV[Int], PV[T], Expr[Unit]] { +class VecRStaDyn[T : Staged : Liftable](r: Ring[PV[T]])(using QuoteContext) extends VecROp[PV[Int], PV[T], Expr[Unit]] { val VSta: VecROp[Int, PV[T], Expr[Unit]] = new VecRStaDim(r) val VDyn = new VecRDyn val dyn = Dyns.dyn[T] diff --git a/tests/run-staging/staged-streams_1.scala b/tests/run-staging/staged-streams_1.scala index 72f6e3926d5c..4f8186082ad7 100644 --- a/tests/run-staging/staged-streams_1.scala +++ b/tests/run-staging/staged-streams_1.scala @@ -70,7 +70,7 @@ object Test { case class Linear[A](producer: Producer[A]) extends StagedStream[A] case class Nested[A, B](producer: Producer[B], nestedf: B => StagedStream[A]) extends StagedStream[A] - case class Stream[A: Type](stream: StagedStream[Expr[A]]) { + case class Stream[A: Staged](stream: StagedStream[Expr[A]]) { /** Main consumer * @@ -81,7 +81,7 @@ object Test { * @tparam W the type of the accumulator * @return */ - def fold[W: Type](z: Expr[W], f: ((Expr[W], Expr[A]) => Expr[W])): E[W] = { + def fold[W: Staged](z: Expr[W], f: ((Expr[W], Expr[A]) => Expr[W])): E[W] = { Var(z) { s => '{ ${ foldRaw[Expr[A]]((a: Expr[A]) => s.update(f(s.get, a)), stream) } @@ -121,7 +121,7 @@ object Test { * @tparam B the element type of the returned stream * @return a new stream resulting from applying `mapRaw` and threading the element of the first stream downstream. */ - def map[B : Type](f: (Expr[A] => Expr[B])): Stream[B] = { + def map[B : Staged](f: (Expr[A] => Expr[B])): Stream[B] = { Stream(mapRaw[Expr[A], Expr[B]](a => k => k(f(a)), stream)) } @@ -169,7 +169,7 @@ object Test { } /** Flatmap */ - def flatMap[B : Type](f: (Expr[A] => Stream[B])): Stream[B] = { + def flatMap[B : Staged](f: (Expr[A] => Stream[B])): Stream[B] = { Stream(flatMapRaw[Expr[A], Expr[B]]((a => { val Stream (nested) = f(a); nested }), stream)) } @@ -303,7 +303,7 @@ object Test { * @tparam A the type of the producer's elements. * @return a linear or nested stream aware of the variable reference to decrement. */ - private def takeRaw[A: Type](n: Expr[Int], stream: StagedStream[A])(using QuoteContext): StagedStream[A] = { + private def takeRaw[A: Staged](n: Expr[Int], stream: StagedStream[A])(using QuoteContext): StagedStream[A] = { stream match { case linear: Linear[A] => { val enhancedProducer: Producer[(Var[Int], A)] = addCounter[A](n, linear.producer) @@ -334,7 +334,7 @@ object Test { /** A stream containing the first `n` elements of this stream. */ def take(n: Expr[Int])(using QuoteContext): Stream[A] = Stream(takeRaw[Expr[A]](n, stream)) - private def zipRaw[A: Type, B: Type](stream1: StagedStream[Expr[A]], stream2: StagedStream[B])(using QuoteContext): StagedStream[(Expr[A], B)] = { + private def zipRaw[A: Staged, B: Staged](stream1: StagedStream[Expr[A]], stream2: StagedStream[B])(using QuoteContext): StagedStream[(Expr[A], B)] = { (stream1, stream2) match { case (Linear(producer1), Linear(producer2)) => @@ -402,7 +402,7 @@ object Test { * @tparam A * @return */ - private def makeLinear[A: Type](stream: StagedStream[Expr[A]])(using QuoteContext): Producer[Expr[A]] = { + private def makeLinear[A: Staged](stream: StagedStream[Expr[A]])(using QuoteContext): Producer[Expr[A]] = { stream match { case Linear(producer) => producer case Nested(producer, nestedf) => { @@ -563,14 +563,14 @@ object Test { } /** zip **/ - def zip[B: Type, C: Type](f: (Expr[A] => Expr[B] => Expr[C]), stream2: Stream[B])(using QuoteContext): Stream[C] = { + def zip[B: Staged, C: Staged](f: (Expr[A] => Expr[B] => Expr[C]), stream2: Stream[B])(using QuoteContext): Stream[C] = { val Stream(stream_b) = stream2 Stream(mapRaw[(Expr[A], Expr[B]), Expr[C]]((t => k => k(f(t._1)(t._2))), zipRaw[A, Expr[B]](stream, stream_b))) } } object Stream { - def of[A: Type](arr: Expr[Array[A]])(using QuoteContext): Stream[A] = { + def of[A: Staged](arr: Expr[Array[A]])(using QuoteContext): Stream[A] = { val prod = new Producer[Expr[A]] { type St = (Var[Int], Var[Int], Expr[Array[A]]) diff --git a/tests/run-staging/staged-tuples/StagedTuple.scala b/tests/run-staging/staged-tuples/StagedTuple.scala index 9640a0640e81..42ee9017e627 100644 --- a/tests/run-staging/staged-tuples/StagedTuple.scala +++ b/tests/run-staging/staged-tuples/StagedTuple.scala @@ -35,7 +35,7 @@ object StagedTuple { } } - def fromArrayStaged[T <: Tuple : Type](xs: Expr[Array[Object]], size: Option[Int])(using QuoteContext): Expr[T] = { + def fromArrayStaged[T <: Tuple : Staged](xs: Expr[Array[Object]], size: Option[Int])(using QuoteContext): Expr[T] = { if (!specialize) '{scala.runtime.Tuple.fromArray($xs)}.as[T] else xs.bind { xs => val tup: Expr[Any] = size match { @@ -69,7 +69,7 @@ object StagedTuple { } } - def sizeStaged[Res <: Int : Type](tup: Expr[Tuple], size: Option[Int])(using QuoteContext): Expr[Res] = { + def sizeStaged[Res <: Int : Staged](tup: Expr[Tuple], size: Option[Int])(using QuoteContext): Expr[Res] = { val res = if (!specialize) '{scala.runtime.Tuple.size($tup)} else size match { @@ -79,7 +79,7 @@ object StagedTuple { res.as[Res] } - def headStaged[Tup <: NonEmptyTuple : Type](tup: Expr[Tup], size: Option[Int])(using QuoteContext): Expr[Head[Tup]] = { + def headStaged[Tup <: NonEmptyTuple : Staged](tup: Expr[Tup], size: Option[Int])(using QuoteContext): Expr[Head[Tup]] = { if (!specialize) '{scala.runtime.Tuple.apply($tup, 0)}.as[Head[Tup]] else { val resVal = size match { @@ -102,7 +102,7 @@ object StagedTuple { } } - def tailStaged[Tup <: NonEmptyTuple : Type](tup: Expr[Tup], size: Option[Int])(using QuoteContext): Expr[Tail[Tup]] = { + def tailStaged[Tup <: NonEmptyTuple : Staged](tup: Expr[Tup], size: Option[Int])(using QuoteContext): Expr[Tail[Tup]] = { if (!specialize) '{scala.runtime.Tuple.tail($tup)}.as[Tail[Tup]] else { val res = size match { @@ -126,7 +126,7 @@ object StagedTuple { } } - def applyStaged[Tup <: NonEmptyTuple : Type, N <: Int : Type](tup: Expr[Tup], size: Option[Int], n: Expr[N], nValue: Option[Int])(using qctx: QuoteContext): Expr[Elem[Tup, N]] = { + def applyStaged[Tup <: NonEmptyTuple : Staged, N <: Int : Staged](tup: Expr[Tup], size: Option[Int], n: Expr[N], nValue: Option[Int])(using qctx: QuoteContext): Expr[Elem[Tup, N]] = { if (!specialize) '{scala.runtime.Tuple.apply($tup, $n)}.as[Elem[Tup, N]] else { @@ -185,7 +185,7 @@ object StagedTuple { } } - def consStaged[T <: Tuple & Singleton : Type, H : Type](self: Expr[T], x: Expr[H], tailSize: Option[Int])(using QuoteContext): Expr[H *: T] = + def consStaged[T <: Tuple & Singleton : Staged, H : Staged](self: Expr[T], x: Expr[H], tailSize: Option[Int])(using QuoteContext): Expr[H *: T] = if (!specialize) '{scala.runtime.Tuple.cons($x, $self)}.as[H *: T] else { val res = tailSize match { @@ -205,7 +205,7 @@ object StagedTuple { res.as[H *: T] } - def concatStaged[Self <: Tuple & Singleton : Type, That <: Tuple & Singleton : Type](self: Expr[Self], selfSize: Option[Int], that: Expr[That], thatSize: Option[Int])(using QuoteContext): Expr[Concat[Self, That]] = { + def concatStaged[Self <: Tuple & Singleton : Staged, That <: Tuple & Singleton : Staged](self: Expr[Self], selfSize: Option[Int], that: Expr[That], thatSize: Option[Int])(using QuoteContext): Expr[Concat[Self, That]] = { if (!specialize) '{scala.runtime.Tuple.concat($self, $that)}.as[Concat[Self, That]] else { def genericConcat(xs: Expr[Tuple], ys: Expr[Tuple]): Expr[Tuple] = @@ -254,11 +254,11 @@ object StagedTuple { } } - private implicit class ExprOps[U: Type](expr: Expr[U]) { + private implicit class ExprOps[U: Staged](expr: Expr[U]) { - def as[T: Type](using QuoteContext): Expr[T] = '{ $expr.asInstanceOf[T] } + def as[T: Staged](using QuoteContext): Expr[T] = '{ $expr.asInstanceOf[T] } - def bind[T: Type](in: Expr[U] => Expr[T])(using QuoteContext): Expr[T] = '{ + def bind[T: Staged](in: Expr[U] => Expr[T])(using QuoteContext): Expr[T] = '{ val t: U = $expr ${in('t)} }