diff --git a/tests/neg-macros/delegate-match-1/Macro_1.scala b/tests/neg-macros/delegate-match-1/Macro_1.scala index 0809831f56c2..73e6bc454259 100644 --- a/tests/neg-macros/delegate-match-1/Macro_1.scala +++ b/tests/neg-macros/delegate-match-1/Macro_1.scala @@ -5,7 +5,7 @@ inline def f: Any = ${ fImpl } private def fImpl(using qctx: QuoteContext): Expr[Unit] = { import qctx.reflect._ - Implicits.search(('[A]).unseal.tpe) match { + Implicits.search((Type[A]).unseal.tpe) match { case x: ImplicitSearchSuccess => '{} case x: DivergingImplicit => '{} diff --git a/tests/neg-macros/delegate-match-2/Macro_1.scala b/tests/neg-macros/delegate-match-2/Macro_1.scala index 8c0518e8755c..6a30da2ef7fb 100644 --- a/tests/neg-macros/delegate-match-2/Macro_1.scala +++ b/tests/neg-macros/delegate-match-2/Macro_1.scala @@ -5,7 +5,7 @@ inline def f: Any = ${ fImpl } private def fImpl (using qctx: QuoteContext) : Expr[Unit] = { import qctx.reflect._ - Implicits.search(('[A]).unseal.tpe) match { + Implicits.search((Type[A]).unseal.tpe) match { case x: ImplicitSearchSuccess => '{} case x: DivergingImplicit => '{} diff --git a/tests/neg-macros/delegate-match-3/Macro_1.scala b/tests/neg-macros/delegate-match-3/Macro_1.scala index bf6d3a7e278c..db3a2b0b7163 100644 --- a/tests/neg-macros/delegate-match-3/Macro_1.scala +++ b/tests/neg-macros/delegate-match-3/Macro_1.scala @@ -5,7 +5,7 @@ inline def f: Any = ${ fImpl } private def fImpl(using qctx: QuoteContext) : Expr[Unit] = { import qctx.reflect._ - Implicits.search(('[A]).unseal.tpe) match { + Implicits.search((Type[A]).unseal.tpe) match { case x: ImplicitSearchSuccess => '{} case x: DivergingImplicit => '{} diff --git a/tests/neg-macros/i4493-b.scala b/tests/neg-macros/i4493-b.scala index 235f14c0a4a9..c3b9f6cdeab6 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.Type[K] = Type[K] // error '{new Index[K]} } } diff --git a/tests/neg-macros/i4493.scala b/tests/neg-macros/i4493.scala index 852ac0d44d54..810594a06339 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.Type[K] = Type[K] // error '{new Index[K]} } } diff --git a/tests/neg-macros/i6530.scala b/tests/neg-macros/i6530.scala index 7beb719ba6c5..b6d610eef540 100644 --- a/tests/neg-macros/i6530.scala +++ b/tests/neg-macros/i6530.scala @@ -1,4 +1,4 @@ object Macros { - inline def q : Int = ${ '[ Int ] } // error + inline def q : Int = ${ Type[ Int ] } // error val x : Int = 1 + q } \ No newline at end of file diff --git a/tests/neg-macros/i6530b.scala b/tests/neg-macros/i6530b.scala index 9a36fa93c3dc..c8d0113ee67f 100644 --- a/tests/neg-macros/i6530b.scala +++ b/tests/neg-macros/i6530b.scala @@ -4,9 +4,9 @@ object Foo { val tpe: quoted.Type[Int] = ??? val expr: quoted.Expr[Int] = ??? - val a: quoted.Expr[Int] = ${ '[Int] } // error + val a: quoted.Expr[Int] = ${ Type[Int] } // error val b: quoted.Expr[Int] = '{ $tpe } // error val c: ${ '{ 43 } } = ??? // error - val d: quoted.Type[Int] = '[ $expr ] // error + val d: quoted.Type[Int] = Type[ $expr ] // error } } diff --git a/tests/neg-macros/i7013.scala b/tests/neg-macros/i7013.scala index 07232e453ba4..8892522ad508 100644 --- a/tests/neg-macros/i7013.scala +++ b/tests/neg-macros/i7013.scala @@ -2,5 +2,5 @@ import quoted._ def foo()(using QuoteContext) = { class C - '[C] // error + Type[C] // error } diff --git a/tests/neg-macros/i7013b.scala b/tests/neg-macros/i7013b.scala index f144e254b2d1..917df1683f62 100644 --- a/tests/neg-macros/i7013b.scala +++ b/tests/neg-macros/i7013b.scala @@ -3,6 +3,6 @@ import quoted._ class Foo { class Bar def foo()(using QuoteContext) = { - '[Bar] // error + Type[Bar] // error } } diff --git a/tests/neg-macros/i7013c.scala b/tests/neg-macros/i7013c.scala index 1a69c8c077f1..32a02f77c876 100644 --- a/tests/neg-macros/i7013c.scala +++ b/tests/neg-macros/i7013c.scala @@ -2,5 +2,5 @@ import quoted._ def foo()(using QuoteContext) = { type C - '[C] // error + Type[C] // error } diff --git a/tests/neg-macros/i7121.scala b/tests/neg-macros/i7121.scala index 467fdd54be83..e13074000bc8 100644 --- a/tests/neg-macros/i7121.scala +++ b/tests/neg-macros/i7121.scala @@ -7,7 +7,7 @@ class Test()(implicit qtx: QuoteContext) { @annot1('{4}) // error def foo(str: String) = () - @annot2(4)(using '[Int]) // error + @annot2(4)(using Type[Int]) // error def foo2(str: String) = () } diff --git a/tests/pos-macros/i4023c/Macro_1.scala b/tests/pos-macros/i4023c/Macro_1.scala index 33feeda9e5a8..c6caf6bac980 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]) } + inline def ff[T](x: T): T = ${ impl('x)(Type[T], summon[QuoteContext]) } def impl[T](x: Expr[T])(implicit t: Type[T], qctx: QuoteContext): Expr[T] = '{ $x: $t } } diff --git a/tests/pos-macros/i4539.scala b/tests/pos-macros/i4539.scala index eda10e5dc926..a5931bd12422 100644 --- a/tests/pos-macros/i4539.scala +++ b/tests/pos-macros/i4539.scala @@ -1,5 +1,5 @@ import scala.quoted._ def test(using QuoteContext) = { - val q = '[String] - '[String] + val q = Type[String] + Type[String] } diff --git a/tests/pos-macros/i4539b.scala b/tests/pos-macros/i4539b.scala index 8e0c813bdef3..fa5e05fa0f3b 100644 --- a/tests/pos-macros/i4539b.scala +++ b/tests/pos-macros/i4539b.scala @@ -1,22 +1,22 @@ import scala.quoted._ -def test(using QuoteContext) = { +def test(using QuoteContext): Unit = { def f = { { - '[String] - '[String] + Type[String] + Type[String] } - '[String] match { case _ => } - try '[String] catch { case _ => } + Type[String] match { case _ => } + try Type[String] catch { case _ => } - '[String] - '[String] + Type[String] + Type[String] } def bar[T](t: Type[T]) = ??? - bar('[String]) + bar(Type[String]) class Baz[T](t: Type[T]) - new Baz('[String]) + new Baz(Type[String]) } diff --git a/tests/pos-macros/i6140.scala b/tests/pos-macros/i6140.scala index 96247819bc1f..6a18e67e829d 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:Type](t : Trait[T])(using QuoteContext): Type[T] = Type[t.t] } diff --git a/tests/pos-macros/i6142.scala b/tests/pos-macros/i6142.scala index fc726dd4b025..c6c8715996f0 100644 --- a/tests/pos-macros/i6142.scala +++ b/tests/pos-macros/i6142.scala @@ -4,7 +4,7 @@ object O { def foo(using QuoteContext) = { type T implicit val _: scala.quoted.Type[T] = ??? - '[List[T]] + Type[List[T]] () } } diff --git a/tests/pos-macros/i6210/Macros_1.scala b/tests/pos-macros/i6210/Macros_1.scala index 24c4fb839c7b..b54747d9d20b 100644 --- a/tests/pos-macros/i6210/Macros_1.scala +++ b/tests/pos-macros/i6210/Macros_1.scala @@ -5,7 +5,7 @@ object Macro { ${ impl[A, B] } def impl[A : Type, B : Type](using QuoteContext): Expr[Any] = { - val t = '[Map[A, B]] + val t = Type[Map[A, B]] '{ new Object().asInstanceOf[$t] ???.asInstanceOf[$t] diff --git a/tests/pos-macros/i7048b.scala b/tests/pos-macros/i7048b.scala index f81077c0ef6c..ed59bc0fb0b8 100644 --- a/tests/pos-macros/i7048b.scala +++ b/tests/pos-macros/i7048b.scala @@ -7,6 +7,6 @@ trait IsExpr { val foo: IsExpr = ??? def g()(using QuoteContext): Unit = { - val a = '[foo.Underlying] + val a = Type[foo.Underlying] () } diff --git a/tests/pos-macros/i7264.scala b/tests/pos-macros/i7264.scala index 1b6e88c669be..a4f2c7722be2 100644 --- a/tests/pos-macros/i7264.scala +++ b/tests/pos-macros/i7264.scala @@ -2,6 +2,6 @@ import scala.quoted._ class Foo { def f[T2](t: Type[T2])(using QuoteContext) = t match { case '[ *:[Int, $T] ] => - '[ *:[Int, T] ] + Type[ *:[Int, T] ] } } \ No newline at end of file diff --git a/tests/pos-macros/i7264b.scala b/tests/pos-macros/i7264b.scala index eae0b81ebdd2..ab26562b94ed 100644 --- a/tests/pos-macros/i7264b.scala +++ b/tests/pos-macros/i7264b.scala @@ -2,6 +2,6 @@ import scala.quoted._ class Foo { def f[T2: Type](e: Expr[T2])(using QuoteContext) = e match { case '{ $x: *:[Int, $t] } => - '[ *:[Int, t] ] + Type[ *:[Int, t] ] } } diff --git a/tests/pos-macros/i7264c.scala b/tests/pos-macros/i7264c.scala index f98b4d8c04e7..a49026549be1 100644 --- a/tests/pos-macros/i7264c.scala +++ b/tests/pos-macros/i7264c.scala @@ -4,6 +4,6 @@ class Foo { case '{ $x: $T0 } => Type[T0] match case '[ *:[Int, $T] ] => - '[ *:[Int, T] ] + Type[ *:[Int, T] ] } } diff --git a/tests/pos-macros/i7405.scala b/tests/pos-macros/i7405.scala index 4526758501d8..c90445068ad7 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: Type[X] = Type[X] // Level 0 '{ val y: $t = x } } } diff --git a/tests/pos-macros/i7405b.scala b/tests/pos-macros/i7405b.scala index f2fb52b02d60..6b4cf9233153 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: Type[Z] = Type[Z] '{ val y: $t = x.y } } } diff --git a/tests/pos-macros/i8100.scala b/tests/pos-macros/i8100.scala index 374d9e086ac7..04c7aa4c0ebe 100644 --- a/tests/pos-macros/i8100.scala +++ b/tests/pos-macros/i8100.scala @@ -10,10 +10,10 @@ def f[T: Type](using QuoteContext) = '{ val m = $mm type ME = m.E - ${ g[ME](using '[ME]) } - ${ g[m.E](using '[ME]) } - ${ g[ME](using '[m.E]) } - ${ g[m.E](using '[m.E]) } + ${ g[ME](using Type[ME]) } + ${ g[m.E](using Type[ME]) } + ${ g[ME](using Type[m.E]) } + ${ g[m.E](using Type[m.E]) } // ${ g[ME] } // FIXME: issue seems to be in ReifyQuotes // ${ g[m.E] } // FIXME: issue seems to be in ReifyQuotes } diff --git a/tests/pos-macros/i8302.scala b/tests/pos-macros/i8302.scala index 46fd22acc7e0..d3aadf750e92 100644 --- a/tests/pos-macros/i8302.scala +++ b/tests/pos-macros/i8302.scala @@ -2,7 +2,7 @@ import scala.quoted._ def foo[T](using qctx: QuoteContext, tpe: Type[T]): Expr[Any] = '{ (using qctx: QuoteContext) => type TT = T - val t = '[TT] + val t = Type[TT] ??? } diff --git a/tests/pos-macros/i9518/Macro_1.scala b/tests/pos-macros/i9518/Macro_1.scala index e5382aff03a0..d439c892bfe9 100644 --- a/tests/pos-macros/i9518/Macro_1.scala +++ b/tests/pos-macros/i9518/Macro_1.scala @@ -8,11 +8,11 @@ inline def shift : Unit = ${ shiftTerm } def shiftTerm(using QuoteContext): Expr[Unit] = { import qctx.reflect._ val nTree = '{ ??? : CB[Int] }.unseal - val tp1 = '[CB[Int]].unseal.tpe - val tp2 = '[([X] =>> CB[X])[Int]].unseal.tpe - val ta = '[[X] =>> CB[X]] - val tp3 = '[ta.Underlying[Int]].unseal.tpe - val tp4 = '[CB].unseal.tpe.appliedTo(TypeRepr.of[Int]) + val tp1 = Type[CB[Int]].unseal.tpe + val tp2 = Type[([X] =>> CB[X])[Int]].unseal.tpe + val ta = Type[[X] =>> CB[X]] + val tp3 = Type[ta.Underlying[Int]].unseal.tpe + val tp4 = Type[CB].unseal.tpe.appliedTo(TypeRepr.of[Int]) assert(nTree.tpe <:< tp1) assert(nTree.tpe <:< tp2) assert(nTree.tpe <:< tp3) diff --git a/tests/pos-macros/macro-with-type/Macro_1.scala b/tests/pos-macros/macro-with-type/Macro_1.scala index 3a00191873d5..dfdd68f454c3 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])} + inline def ff: Unit = ${impl(Type[Int])} def impl(t: Type[Int])(using QuoteContext): Expr[Unit] = '{} } diff --git a/tests/pos-macros/quote-1.scala b/tests/pos-macros/quote-1.scala index 1f02e1fb9233..0790c2eeb74b 100644 --- a/tests/pos-macros/quote-1.scala +++ b/tests/pos-macros/quote-1.scala @@ -7,9 +7,9 @@ class Test(using QuoteContext) { val z = $x } - f('{2})('[Int]) - f('{ true })('[Boolean]) + f('{2})(Type[Int]) + f('{ true })(Type[Boolean]) def g(es: Expr[String], t: Type[String]) = - f('{ ($es + "!") :: Nil })('[List[$t]]) + f('{ ($es + "!") :: Nil })(Type[List[t.Underlying]]) } 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 900d63379cee..56d476e8019c 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 @@ -1,7 +1,7 @@ import scala.quoted._ -inline def isFunctionType[T]: Boolean = ${ isFunctionTypeImpl('[T]) } +inline def isFunctionType[T]: Boolean = ${ isFunctionTypeImpl(Type[T]) } def isFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ @@ -9,7 +9,7 @@ def isFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] } -inline def isContextFunctionType[T]: Boolean = ${ isContextFunctionTypeImpl('[T]) } +inline def isContextFunctionType[T]: Boolean = ${ isContextFunctionTypeImpl(Type[T]) } def isContextFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ @@ -17,14 +17,14 @@ def isContextFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[B } -inline def isErasedFunctionType[T]: Boolean = ${ isErasedFunctionTypeImpl('[T]) } +inline def isErasedFunctionType[T]: Boolean = ${ isErasedFunctionTypeImpl(Type[T]) } def isErasedFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ Expr(tp.unseal.tpe.isErasedFunctionType) } -inline def isDependentFunctionType[T]: Boolean = ${ isDependentFunctionTypeImpl('[T]) } +inline def isDependentFunctionType[T]: Boolean = ${ isDependentFunctionTypeImpl(Type[T]) } def isDependentFunctionTypeImpl[T](tp: Type[T])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ 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 02e8fc7c9f2b..725dea7da052 100644 --- a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala +++ b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala @@ -5,28 +5,28 @@ import scala.quoted._ object TypeToolbox { /** are the two types equal? */ - inline def =:=[A, B]: Boolean = ${tpEqImpl('[A], '[B])} + inline def =:=[A, B]: Boolean = ${tpEqImpl(Type[A], Type[B])} private def tpEqImpl[A, B](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ Expr(a.unseal.tpe =:= b.unseal.tpe) } /** is `tp1` a subtype of `tp2` */ - inline def <:<[A, B]: Boolean = ${tpLEqImpl('[A], '[B])} + inline def <:<[A, B]: Boolean = ${tpLEqImpl(Type[A], Type[B])} private def tpLEqImpl[A, B](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ Expr(a.unseal.tpe <:< b.unseal.tpe) } /** type associated with the tree */ - inline def typeOf[T, Expected](a: T): Boolean = ${typeOfImpl('a, '[Expected])} + inline def typeOf[T, Expected](a: T): Boolean = ${typeOfImpl('a, Type[Expected])} private def typeOfImpl(a: Expr[_], expected: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ Expr(a.unseal.tpe =:= expected.unseal.tpe) } /** does the type refer to a case class? */ - inline def isCaseClass[A]: Boolean = ${isCaseClassImpl('[A])} + inline def isCaseClass[A]: Boolean = ${isCaseClassImpl(Type[A])} private def isCaseClassImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ val sym = tp.unseal.symbol @@ -34,66 +34,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])} + inline def caseFields[T]: List[String] = ${caseFieldsImpl(Type[T])} private def caseFieldsImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[List[String]] = { import qctx.reflect._ val fields = tp.unseal.symbol.caseFields.map(_.name) Expr(fields) } - inline def fieldIn[T](inline mem: String): String = ${fieldInImpl('[T], 'mem)} + inline def fieldIn[T](inline mem: String): String = ${fieldInImpl(Type[T], 'mem)} private def fieldInImpl(t: Type[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[String] = { import qctx.reflect._ val field = t.unseal.symbol.field(mem.unliftOrError) Expr(if field.isNoSymbol then "" else field.name) } - inline def fieldsIn[T]: Seq[String] = ${fieldsInImpl('[T])} + inline def fieldsIn[T]: Seq[String] = ${fieldsInImpl(Type[T])} private def fieldsInImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.reflect._ val fields = t.unseal.symbol.fields Expr(fields.map(_.name).toList) } - inline def methodIn[T](inline mem: String): Seq[String] = ${methodInImpl('[T], 'mem)} + inline def methodIn[T](inline mem: String): Seq[String] = ${methodInImpl(Type[T], 'mem)} private def methodInImpl(t: Type[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.reflect._ Expr(t.unseal.symbol.classMethod(mem.unliftOrError).map(_.name)) } - inline def methodsIn[T]: Seq[String] = ${methodsInImpl('[T])} + inline def methodsIn[T]: Seq[String] = ${methodsInImpl(Type[T])} private def methodsInImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.reflect._ Expr(t.unseal.symbol.classMethods.map(_.name)) } - inline def method[T](inline mem: String): Seq[String] = ${methodImpl('[T], 'mem)} + inline def method[T](inline mem: String): Seq[String] = ${methodImpl(Type[T], 'mem)} private def methodImpl(t: Type[_], mem: Expr[String])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.reflect._ Expr(t.unseal.symbol.method(mem.unliftOrError).map(_.name)) } - inline def methods[T]: Seq[String] = ${methodsImpl('[T])} + inline def methods[T]: Seq[String] = ${methodsImpl(Type[T])} private def methodsImpl(t: Type[_])(using qctx: QuoteContext) : Expr[Seq[String]] = { import qctx.reflect._ Expr(t.unseal.symbol.methods.map(_.name)) } - inline def typeTag[T](x: T): String = ${typeTagImpl('[T])} + inline def typeTag[T](x: T): String = ${typeTagImpl(Type[T])} private def typeTagImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[String] = { import qctx.reflect._ val res = tp.unseal.tpe.show Expr(res) } - inline def companion[T1, T2]: Boolean = ${companionImpl('[T1], '[T2])} + inline def companion[T1, T2]: Boolean = ${companionImpl(Type[T1], Type[T2])} private def companionImpl(t1: Type[_], t2: Type[_])(using qctx: QuoteContext) : Expr[Boolean] = { import qctx.reflect._ val res = t1.unseal.symbol.companionModule == t2.unseal.symbol Expr(res) } - inline def companionName[T1]: String = ${companionNameImpl('[T1])} + inline def companionName[T1]: String = ${companionNameImpl(Type[T1])} private def companionNameImpl(tp: Type[_])(using qctx: QuoteContext) : Expr[String] = { import qctx.reflect._ val sym = tp.unseal.symbol diff --git a/tests/run-macros/i8007/Macro_1.scala b/tests/run-macros/i8007/Macro_1.scala index 1f118fb56f4c..74c932b55b5b 100644 --- a/tests/run-macros/i8007/Macro_1.scala +++ b/tests/run-macros/i8007/Macro_1.scala @@ -19,7 +19,7 @@ object Macro1 { def test1Impl[T: Type](value: Expr[T])(using qctx: QuoteContext): Expr[List[String]] = { import qctx.reflect._ - val mirrorTpe = '[Mirror.Of[T]] + val mirrorTpe = Type[Mirror.Of[T]] Expr.summon(using mirrorTpe).get match { case '{ $m: Mirror.ProductOf[T]{ type MirroredElemLabels = $Elems } } => { diff --git a/tests/run-macros/i8007/Macro_2.scala b/tests/run-macros/i8007/Macro_2.scala index 3f4df0d92e60..1d3c82a55d84 100644 --- a/tests/run-macros/i8007/Macro_2.scala +++ b/tests/run-macros/i8007/Macro_2.scala @@ -45,7 +45,7 @@ object Macro2 { def test2Impl[T: Type](value: Expr[T])(using qctx: QuoteContext): Expr[Unit] = { import qctx.reflect._ - val mirrorTpe = '[Mirror.Of[T]] + val mirrorTpe = Type[Mirror.Of[T]] val mirrorExpr = Expr.summon(using mirrorTpe).get val derivedInstance = JsonEncoder.derived(mirrorExpr) diff --git a/tests/run-macros/i8007/Macro_3.scala b/tests/run-macros/i8007/Macro_3.scala index edf5d8f4c938..19c389ce63a3 100644 --- a/tests/run-macros/i8007/Macro_3.scala +++ b/tests/run-macros/i8007/Macro_3.scala @@ -35,7 +35,7 @@ object Eq { given derived[T: Type](using qctx: QuoteContext) as Expr[Eq[T]] = { import qctx.reflect._ - val ev: Expr[Mirror.Of[T]] = Expr.summon(using '[Mirror.Of[T]]).get + val ev: Expr[Mirror.Of[T]] = Expr.summon(using Type[Mirror.Of[T]]).get ev match { case '{ $m: Mirror.ProductOf[T] { type MirroredElemTypes = $ElementTypes }} => diff --git a/tests/run-macros/i8514/Macro_1.scala b/tests/run-macros/i8514/Macro_1.scala index 545aaf99c802..f3aa6e71133a 100644 --- a/tests/run-macros/i8514/Macro_1.scala +++ b/tests/run-macros/i8514/Macro_1.scala @@ -10,9 +10,9 @@ def testExpr(using QuoteContext): Expr[Unit] = { import qctx.reflect._ '{ - println(${Expr('[Object].unseal.tpe.baseClasses.toString)}) - println(${Expr('[A].unseal.tpe.baseClasses.toString)}) - println(${Expr('[B].unseal.tpe.baseClasses.toString)}) - println(${Expr('[C].unseal.tpe.baseClasses.toString)}) + println(${Expr(Type[Object].unseal.tpe.baseClasses.toString)}) + println(${Expr(Type[A].unseal.tpe.baseClasses.toString)}) + println(${Expr(Type[B].unseal.tpe.baseClasses.toString)}) + println(${Expr(Type[C].unseal.tpe.baseClasses.toString)}) } } diff --git a/tests/run-macros/i8514b/Macro_1.scala b/tests/run-macros/i8514b/Macro_1.scala index d339dfd3fc34..9bef0f3cac09 100644 --- a/tests/run-macros/i8514b/Macro_1.scala +++ b/tests/run-macros/i8514b/Macro_1.scala @@ -9,7 +9,7 @@ inline def test(): Unit = ${ testExpr } def testExpr(using QuoteContext): Expr[Unit] = { import qctx.reflect._ - val t = '[B].unseal.tpe + val t = Type[B].unseal.tpe val baseTypes = t.baseClasses.map(b => t.baseType(b)) '{ diff --git a/tests/run-macros/i8520/Macro_1.scala b/tests/run-macros/i8520/Macro_1.scala index 472a17b98be6..2fe47f7fe8a3 100644 --- a/tests/run-macros/i8520/Macro_1.scala +++ b/tests/run-macros/i8520/Macro_1.scala @@ -8,6 +8,6 @@ def testExpr[T[_]: Type](using QuoteContext): Expr[Unit] = { if f.is(Flags.Covariant) then "+" else if f.is(Flags.Contravariant) then "-" else " " - val t = '[T].unseal.tpe.typeSymbol.typeMembers.map(x => (x.name, variance(x.flags))) + val t = Type[T].unseal.tpe.typeSymbol.typeMembers.map(x => (x.name, variance(x.flags))) '{ println(${Expr(t.toString)}) } } 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..f60e23725059 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 @@ -5,7 +5,7 @@ object Index { implicit def zero[K, T]: Index[K, (K, T)] = new Index(0) - implicit inline def succ[K, H, T](implicit prev: => Index[K, T]): Index[K, (H, T)] = ${succImpl('[K], '[H], '[T])} + implicit inline def succ[K, H, T](implicit prev: => Index[K, T]): Index[K, (H, T)] = ${succImpl(Type[K], Type[H], Type[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 diff --git a/tests/run-macros/quote-type-matcher/quoted_1.scala b/tests/run-macros/quote-type-matcher/quoted_1.scala index a4aaa4dd451e..b29ea1212d80 100644 --- a/tests/run-macros/quote-type-matcher/quoted_1.scala +++ b/tests/run-macros/quote-type-matcher/quoted_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Macros { - inline def matches[A, B]: Unit = ${ matchesExpr('[A], '[B]) } + inline def matches[A, B]: Unit = ${ matchesExpr(Type[A], Type[B]) } private def matchesExpr[A, B](a: Type[A], b: Type[B])(using qctx: QuoteContext) : Expr[Unit] = { import qctx.reflect._ diff --git a/tests/run-macros/refined-selectable-macro/Macro_1.scala b/tests/run-macros/refined-selectable-macro/Macro_1.scala index 1e8bcd490f9f..864944e34a81 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_1.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_1.scala @@ -89,7 +89,7 @@ object Macro { val r = rec(repr, Set.empty) - val refinementType = r.foldLeft('[T].unseal.tpe)((acc, e) => Refinement(acc, e._1, e._2)).seal + val refinementType = r.foldLeft(Type[T].unseal.tpe)((acc, e) => Refinement(acc, e._1, e._2)).seal refinementType match { case '[$T] => '{ $newRecord($s.toArray.map(e => e.asInstanceOf[(String, Any)])).asInstanceOf[T] } diff --git a/tests/run-macros/refined-selectable-macro/Macro_2.scala b/tests/run-macros/refined-selectable-macro/Macro_2.scala index cccfcc74e44c..0102259c912f 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_2.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_2.scala @@ -14,7 +14,7 @@ object Macro2 { object Record extends SelectableRecordCompanion[Record] { import scala.quoted._ - inline def apply[R <: Record](elems: (String, Any)*) : R = ${ applyImpl('elems, '[R]) } + inline def apply[R <: Record](elems: (String, Any)*) : R = ${ applyImpl('elems, Type[R]) } def applyImpl[R <: Record: Type](elems: Expr[Seq[(String, Any)]], ev: Type[R])(using qctx: QuoteContext) = { '{ new Record($elems:_*).asInstanceOf[$ev] } diff --git a/tests/run-macros/string-context-implicits/Macro_1.scala b/tests/run-macros/string-context-implicits/Macro_1.scala index 79a5dac14073..c439444d8451 100644 --- a/tests/run-macros/string-context-implicits/Macro_1.scala +++ b/tests/run-macros/string-context-implicits/Macro_1.scala @@ -8,7 +8,7 @@ private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using case Varargs(argExprs) => val argShowedExprs = argExprs.map { case '{ $arg: $Tp } => - val showTp = '[Show[Tp]] + val showTp = Type[Show[Tp]] Expr.summon(using showTp) match { case Some(showExpr) => '{ $showExpr.show($arg) } case None => report.error(s"could not find implicit for ${showTp.show}", arg); '{???} diff --git a/tests/run-macros/tasty-construct-types/Macro_1.scala b/tests/run-macros/tasty-construct-types/Macro_1.scala index 57605b80e606..2be63040e607 100644 --- a/tests/run-macros/tasty-construct-types/Macro_1.scala +++ b/tests/run-macros/tasty-construct-types/Macro_1.scala @@ -40,14 +40,14 @@ object Macros { tl => TypeRepr.of[scala.internal.MatchCase].appliedTo(List(TypeRepr.of[List].appliedTo(tl.param(0)), tl.param(0))))) ) - assert(x1T =:= '[1].unseal.tpe) - assert(x2T =:= '[1|2].unseal.tpe) - assert(x3T =:= '[3&Any].unseal.tpe) - assert(x4T =:= '[[A,B] =>> B].unseal.tpe) - assert(x5T =:= '[RefineMe { type T = Int }].unseal.tpe) - assert(x6T =:= '[List[Int]].unseal.tpe) - assert(x7T =:= '[7 @TestAnnotation].unseal.tpe) - assert(x8T =:= '[List[8] match { case List[t] => t }].unseal.tpe) + assert(x1T =:= Type[1].unseal.tpe) + assert(x2T =:= Type[1|2].unseal.tpe) + assert(x3T =:= Type[3&Any].unseal.tpe) + assert(x4T =:= Type[[A,B] =>> B].unseal.tpe) + assert(x5T =:= Type[RefineMe { type T = Int }].unseal.tpe) + assert(x6T =:= Type[List[Int]].unseal.tpe) + assert(x7T =:= Type[7 @TestAnnotation].unseal.tpe) + assert(x8T =:= Type[List[8] match { case List[t] => t }].unseal.tpe) '{ println("Ok") diff --git a/tests/run-macros/tasty-dealias/quoted_1.scala b/tests/run-macros/tasty-dealias/quoted_1.scala index 55382f30348c..f6885c410d91 100644 --- a/tests/run-macros/tasty-dealias/quoted_1.scala +++ b/tests/run-macros/tasty-dealias/quoted_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Macros { - inline def dealias[T]: String = ${ impl('[T]) } + inline def dealias[T]: String = ${ impl(Type[T]) } def impl[T](x: Type[T])(using qctx: QuoteContext) : Expr[String] = { import qctx.reflect._ diff --git a/tests/run-macros/tasty-extractors-types/quoted_1.scala b/tests/run-macros/tasty-extractors-types/quoted_1.scala index 666c30881f0d..97afb977d4f1 100644 --- a/tests/run-macros/tasty-extractors-types/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-types/quoted_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Macros { - implicit inline def printType[T]: Unit = ${ impl('[T]) } + implicit inline def printType[T]: Unit = ${ impl(Type[T]) } def impl[T](x: Type[T])(using qctx: QuoteContext) : Expr[Unit] = { import qctx.reflect._ diff --git a/tests/run-macros/tasty-linenumber/quoted_1.scala b/tests/run-macros/tasty-linenumber/quoted_1.scala index 7d21cf4fb7a3..5b8b4226e900 100644 --- a/tests/run-macros/tasty-linenumber/quoted_1.scala +++ b/tests/run-macros/tasty-linenumber/quoted_1.scala @@ -7,7 +7,7 @@ class LineNumber(val value: Int) { object LineNumber { implicit inline def line[T >: Unit <: Unit]: LineNumber = - ${lineImpl('[T])} + ${lineImpl(Type[T])} def lineImpl(x: Type[Unit])(using QuoteContext) : Expr[LineNumber] = { import qctx.reflect._ diff --git a/tests/run-macros/tasty-macro-positions/quoted_1.scala b/tests/run-macros/tasty-macro-positions/quoted_1.scala index 36fe4965433f..c10fde0d5e64 100644 --- a/tests/run-macros/tasty-macro-positions/quoted_1.scala +++ b/tests/run-macros/tasty-macro-positions/quoted_1.scala @@ -6,7 +6,7 @@ object Macros { inline def fun2(x: =>Any): Unit = ${ impl('x) } - inline def fun3[T]: Unit = ${ impl2('[T]) } + inline def fun3[T]: Unit = ${ impl2(Type[T]) } def impl(x: Expr[Any])(using qctx: QuoteContext) : Expr[Unit] = { import qctx.reflect._ diff --git a/tests/run-macros/tasty-subtyping/quoted_1.scala b/tests/run-macros/tasty-subtyping/quoted_1.scala index 8c6b2048e832..9be8b1ac52d9 100644 --- a/tests/run-macros/tasty-subtyping/quoted_1.scala +++ b/tests/run-macros/tasty-subtyping/quoted_1.scala @@ -3,10 +3,10 @@ import scala.quoted._ object Macros { inline def isTypeEqual[T, U]: Boolean = - ${isTypeEqualImpl('[T], '[U])} + ${isTypeEqualImpl(Type[T], Type[U])} inline def isSubTypeOf[T, U]: Boolean = - ${isSubTypeOfImpl('[T], '[U])} + ${isSubTypeOfImpl(Type[T], Type[U])} def isTypeEqualImpl[T, U](t: Type[T], u: Type[U])(using QuoteContext) : Expr[Boolean] = { import qctx.reflect._ diff --git a/tests/run-macros/type-show/Macro_1.scala b/tests/run-macros/type-show/Macro_1.scala index 9e820802771e..1d15b28b514a 100644 --- a/tests/run-macros/type-show/Macro_1.scala +++ b/tests/run-macros/type-show/Macro_1.scala @@ -1,7 +1,7 @@ import scala.quoted._ object TypeToolbox { - inline def show[A]: String = ${ showImpl('[A]) } + inline def show[A]: String = ${ showImpl(Type[A]) } private def showImpl[A, B](a: Type[A])(using qctx: QuoteContext) : Expr[String] = { import qctx.reflect._ Expr(a.show) diff --git a/tests/run-staging/i3823-b.scala b/tests/run-staging/i3823-b.scala index 1341f86b9412..94fa2dfb402e 100644 --- a/tests/run-staging/i3823-b.scala +++ b/tests/run-staging/i3823-b.scala @@ -6,6 +6,6 @@ object Test { def f[T](x: Expr[T])(implicit t: Type[T]) = '{ val z: $t = $x } - println(f('{2})('[Int]).show) + println(f('{2})(Type[Int]).show) } } diff --git a/tests/run-staging/i3823-c.scala b/tests/run-staging/i3823-c.scala index 3c0aef193d8d..05de42bb2fa5 100644 --- a/tests/run-staging/i3823-c.scala +++ b/tests/run-staging/i3823-c.scala @@ -6,6 +6,6 @@ object Test { def f[T](x: Expr[T])(implicit t: Type[T]) = '{ val z = $x } - println(f('{2})('[Int]).show) + println(f('{2})(Type[Int]).show) } } diff --git a/tests/run-staging/i3823.scala b/tests/run-staging/i3823.scala index c9702d3c1269..b02df1212d8a 100644 --- a/tests/run-staging/i3823.scala +++ b/tests/run-staging/i3823.scala @@ -6,6 +6,6 @@ object Test { def f[T: Type](x: Expr[T])(t: Type[T]) = '{ val z: $t = $x } - println(f('{2})('[Int]).show) + println(f('{2})(Type[Int]).show) } } \ No newline at end of file diff --git a/tests/run-staging/i4044e.scala b/tests/run-staging/i4044e.scala index 331815e1b543..4a9c7f35c833 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: Type[Int] = Type[Int] val q = '{ ${ '{ ($e + $f).asInstanceOf[$t] } } } println(q.show) } diff --git a/tests/run-staging/i5247.scala b/tests/run-staging/i5247.scala index da2a4ee4eae3..983e8070a842 100644 --- a/tests/run-staging/i5247.scala +++ b/tests/run-staging/i5247.scala @@ -8,11 +8,11 @@ object Test { println(bar[Object].show) } def foo[H : Type](using QuoteContext): Expr[H] = { - val t = '[H] + val t = Type[H] '{ null.asInstanceOf[$t] } } def bar[H : Type](using QuoteContext): Expr[List[H]] = { - val t = '[List[H]] + val t = Type[List[H]] '{ null.asInstanceOf[$t] } } } diff --git a/tests/run-staging/i5965.scala b/tests/run-staging/i5965.scala index 5d5f15b17a77..31a0b6072314 100644 --- a/tests/run-staging/i5965.scala +++ b/tests/run-staging/i5965.scala @@ -5,7 +5,7 @@ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = { - withQuoteContext('[List]) + withQuoteContext(Type[List]) def list(using QuoteContext) = bound('{List(1, 2, 3)}) println(withQuoteContext(list.show)) diff --git a/tests/run-staging/i5965b.scala b/tests/run-staging/i5965b.scala index 8850619b912c..e7a90265a2f8 100644 --- a/tests/run-staging/i5965b.scala +++ b/tests/run-staging/i5965b.scala @@ -6,7 +6,7 @@ object Test { def main(args: Array[String]): Unit = { given Toolbox = Toolbox.make(getClass.getClassLoader) - withQuoteContext('[List]) + withQuoteContext(Type[List]) def list(using QuoteContext) = bound('{List(1, 2, 3)}) println(withQuoteContext(list.show)) println(run(list)) diff --git a/tests/run-staging/quote-nested-4.scala b/tests/run-staging/quote-nested-4.scala index efc12f2ec978..f44baf7e7ac6 100644 --- a/tests/run-staging/quote-nested-4.scala +++ b/tests/run-staging/quote-nested-4.scala @@ -6,7 +6,7 @@ object Test { def main(args: Array[String]): Unit = withQuoteContext { val q = '{ (using qctx: QuoteContext) => - val t = '[String] + val t = Type[String] t } diff --git a/tests/run-staging/quote-owners-2.scala b/tests/run-staging/quote-owners-2.scala index b4ad8c2bf60d..616ecae54732 100644 --- a/tests/run-staging/quote-owners-2.scala +++ b/tests/run-staging/quote-owners-2.scala @@ -5,7 +5,7 @@ import scala.quoted.staging._ object Test { given Toolbox = Toolbox.make(getClass.getClassLoader) def main(args: Array[String]): Unit = run { - val q = f(g('[Int])) + val q = f(g(Type[Int])) println(q.show) '{ println($q) } } @@ -22,5 +22,5 @@ object Test { ff } - def g[T](a: Type[T])(using QuoteContext): Type[List[T]] = '[List[$a]] + def g[T](a: Type[T])(using QuoteContext): Type[List[T]] = Type[List[a.Underlying]] } diff --git a/tests/run-staging/quote-simple-hole.scala b/tests/run-staging/quote-simple-hole.scala index af292fe2666b..6bd24a0cf004 100644 --- a/tests/run-staging/quote-simple-hole.scala +++ b/tests/run-staging/quote-simple-hole.scala @@ -15,8 +15,8 @@ object Test { assert(x eq a) assert(x eq b) - val i = '[Int] - val j = '[$i] + val i = Type[Int] + val j = Type[i.Underlying] assert(i eq j) } } diff --git a/tests/run-staging/quote-type-matcher.scala b/tests/run-staging/quote-type-matcher.scala index d05bc9dbdf39..a9e69734a3ef 100644 --- a/tests/run-staging/quote-type-matcher.scala +++ b/tests/run-staging/quote-type-matcher.scala @@ -5,20 +5,20 @@ import scala.reflect.ClassTag object Test { given Toolbox = Toolbox.make(this.getClass.getClassLoader) def main(args: Array[String]): Unit = withQuoteContext { - val '[List[Int]] = '[List[Int]] + val '[List[Int]] = Type[List[Int]] - '[List[Int]] match + Type[List[Int]] match case '[List[$Int]] => println(Type[Int].show) println() - '[Int => Double] match + Type[Int => Double] match case '[Function1[$T1, $R]] => println(Type[T1].show) println(Type[R].show) println() - '[(Int => Short) => Double] match + Type[(Int => Short) => Double] match case '[Function1[Function1[$T1, $R0], $R]] => println(Type[T1].show) println(Type[R0].show) diff --git a/tests/run-staging/quote-type-tags.scala b/tests/run-staging/quote-type-tags.scala index 3b5cd3dedbe3..d589669e5a01 100644 --- a/tests/run-staging/quote-type-tags.scala +++ b/tests/run-staging/quote-type-tags.scala @@ -7,17 +7,17 @@ object Test { def asof[T: Type, U](x: Expr[T], t: Type[U]): Expr[U] = '{$x.asInstanceOf[$t]} - println(asof('{}, '[Unit]).show) - println(asof('{true}, '[Boolean]).show) - println(asof('{0.toByte}, '[Byte]).show) - println(asof('{ 'a' }, '[Char]).show) - println(asof('{1.toShort}, '[Short]).show) - println(asof('{2}, '[Int]).show) - println(asof('{3L}, '[Long]).show) - println(asof('{4f}, '[Float]).show) - println(asof('{5d}, '[Double]).show) + println(asof('{}, Type[Unit]).show) + println(asof('{true}, Type[Boolean]).show) + println(asof('{0.toByte}, Type[Byte]).show) + println(asof('{ 'a' }, Type[Char]).show) + println(asof('{1.toShort}, Type[Short]).show) + println(asof('{2}, Type[Int]).show) + println(asof('{3L}, Type[Long]).show) + println(asof('{4f}, Type[Float]).show) + println(asof('{5d}, Type[Double]).show) - println(asof('{5d}, '[Boolean]).show) // Will clearly fail at runtime but the code can be generated + println(asof('{5d}, Type[Boolean]).show) // Will clearly fail at runtime but the code can be generated '{} } }