diff --git a/community-build/community-projects/dotty-cps-async b/community-build/community-projects/dotty-cps-async index a9777a7b1b2e..5637c2fe2c87 160000 --- a/community-build/community-projects/dotty-cps-async +++ b/community-build/community-projects/dotty-cps-async @@ -1 +1 @@ -Subproject commit a9777a7b1b2e04c4ac51e7b763244f69fcd91837 +Subproject commit 5637c2fe2c87520eab2f0629c0796a78e10e3929 diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 11be13672aa8..ab588594ead5 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 11be13672aa8ac4e634cd396524275f3634e544f +Subproject commit ab588594ead517920309c909312b4ba0502a355c diff --git a/community-build/community-projects/scodec-bits b/community-build/community-projects/scodec-bits index df031e56bad0..95e79563af53 160000 --- a/community-build/community-projects/scodec-bits +++ b/community-build/community-projects/scodec-bits @@ -1 +1 @@ -Subproject commit df031e56bad0ea1d1a96dfe8405a16c0325265a0 +Subproject commit 95e79563af532f50e70eaed2d67f2a4d59a4890d diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index e1820e962ec5..5823688a9ae1 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit e1820e962ec5757323a6e12d5d723badad38cf70 +Subproject commit 5823688a9ae1d3b911e374d7d29c45e73c3be3c2 diff --git a/docs/docs/reference/metaprogramming/macros.md b/docs/docs/reference/metaprogramming/macros.md index 3907cab24b51..e606b41d06c6 100644 --- a/docs/docs/reference/metaprogramming/macros.md +++ b/docs/docs/reference/metaprogramming/macros.md @@ -237,7 +237,7 @@ Here’s a compiler that maps an expression given in the interpreted language to quoted Scala code of type `Expr[Int]`. The compiler takes an environment that maps variable names to Scala `Expr`s. ```scala -import scala.quoted.{given _, _} +import scala.quoted._ def compile(e: Exp, env: Map[String, Expr[Int]])(using QuoteContext): Expr[Int] = e match { case Num(n) => diff --git a/library/src/scala/quoted/matching/ConstSeq.scala b/library/src/scala/quoted/matching/ConstSeq.scala deleted file mode 100644 index dea519760424..000000000000 --- a/library/src/scala/quoted/matching/ConstSeq.scala +++ /dev/null @@ -1,26 +0,0 @@ -package scala.quoted -package matching - -/** Literal sequence of literal constant value expressions */ -object ConstSeq { - - /** Matches literal sequence of literal constant value expressions and return a sequence of values. - * - * Usage: - * ```scala - * inline def sum(args: Int*): Int = ${ sumExpr('args) } - * def sumExpr(argsExpr: Expr[Seq[Int]])(usingusing QuoteContext): Expr[Int] = argsExpr match - * case ConstSeq(args) => - * // args: Seq[Int] - * ... - * } - * ``` - */ - @deprecated("use scala.quoted.Varargs(scala.quoted.Consts(_)) instead", "0.23.0") - def unapply[T](expr: Expr[Seq[T]])(using qctx: QuoteContext): Option[Seq[T]] = - import scala.quoted.Const - expr match - case Varargs(Consts(elems)) => Some(elems) - case _ => None - -} diff --git a/library/src/scala/quoted/matching/ValueSeq.scala b/library/src/scala/quoted/matching/ValueSeq.scala deleted file mode 100644 index 5e25267c5845..000000000000 --- a/library/src/scala/quoted/matching/ValueSeq.scala +++ /dev/null @@ -1,25 +0,0 @@ -package scala.quoted -package matching - -/** Value sequence of value expressions */ -object ValueSeq { - - /** Matches literal sequence of literal constant value expressions and return a sequence of values. - * - * Usage: - * ```scala - * inline def sum(args: Int*): Int = ${ sumExpr('args) } - * def sumExpr(argsExpr: Expr[Seq[Int]])(using QuoteContext): Expr[Int] = argsExpr match - * case Unlifted(args) => - * // args: Seq[Int] - * ... - * } - * ``` - */ - @deprecated("use scala.quoted.Varargs(scala.quoted.Unlifted(_)) instead", "0.23.0") - def unapply[T](expr: Expr[Seq[T]])(using unlift: Unliftable[T], qctx: QuoteContext): Option[Seq[T]] = - expr match - case Varargs(Unlifted(elems)) => Some(elems) - case _ => None - -} diff --git a/library/src/scala/quoted/matching/package.scala b/library/src/scala/quoted/matching/package.scala deleted file mode 100644 index 42ff26b77707..000000000000 --- a/library/src/scala/quoted/matching/package.scala +++ /dev/null @@ -1,32 +0,0 @@ -package scala.quoted - -package object matching { - - /** Find an implicit of type `T` in the current scope given by `qctx`. - * Return `Some` containing the expression of the implicit or - * `None` if implicit resolution failed. - * - * @tparam T type of the implicit parameter - * @param tpe quoted type of the implicit parameter - * @param qctx current context - */ - @deprecated("use scala.quoted.Expr.summon[T] instead", "0.23.0") - def summonExpr[T](using tpe: Type[T])(using qctx: QuoteContext): Option[Expr[T]] = - Expr.summon[T] - - @deprecated("use scala.quoted.Const instead", "0.23.0") - val Const: quoted.Const.type = quoted.Const - - @deprecated("use scala.quoted.Varargs instead", "0.23.0") - val ExprSeq: quoted.Varargs.type = quoted.Varargs - - @deprecated("use scala.quoted.Lambda instead", "0.23.0") - val Lambda: quoted.Lambda.type = quoted.Lambda - - @deprecated("use scala.quoted.Unlifted instead", "0.23.0") - val Value: quoted.Unlifted.type = quoted.Unlifted - - @deprecated("use scala.quoted.Unlifted instead", "0.23.0") - val ValueOfExpr: quoted.Unlifted.type = quoted.Unlifted - -} diff --git a/library/src/scala/util/FromDigits.scala b/library/src/scala/util/FromDigits.scala index 7c90c61b529b..2830818464dc 100644 --- a/library/src/scala/util/FromDigits.scala +++ b/library/src/scala/util/FromDigits.scala @@ -1,7 +1,6 @@ package scala.util import scala.math.{BigInt} import quoted._ -import quoted.matching._ import internal.Chars.digit2int import annotation.internal.sharable diff --git a/tests/disabled/run/xml-interpolation-3/XmlQuote_1.scala b/tests/disabled/run/xml-interpolation-3/XmlQuote_1.scala index 541f93ab2f5e..5ac0daed70d3 100644 --- a/tests/disabled/run/xml-interpolation-3/XmlQuote_1.scala +++ b/tests/disabled/run/xml-interpolation-3/XmlQuote_1.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.tasty.Tasty import scala.quoted.autolift import scala.language.implicitConversions diff --git a/tests/neg-macros/i6976.check b/tests/neg-macros/i6976.check index 462a319452a8..2057e55550b4 100644 --- a/tests/neg-macros/i6976.check +++ b/tests/neg-macros/i6976.check @@ -4,6 +4,6 @@ | ^^^^^^^^^ | Exception occurred while executing macro expansion. | scala.MatchError: Inlined(EmptyTree,List(),Literal(Constant(2))) (of class dotty.tools.dotc.ast.Trees$Inlined) - | at playground.macros$.mcrImpl(Macro_1.scala:12) + | at playground.macros$.mcrImpl(Macro_1.scala:10) | | This location contains code that was inlined from Test_2.scala:5 diff --git a/tests/neg-macros/i6976/Macro_1.scala b/tests/neg-macros/i6976/Macro_1.scala index c54c7be7d188..25543bc03a10 100644 --- a/tests/neg-macros/i6976/Macro_1.scala +++ b/tests/neg-macros/i6976/Macro_1.scala @@ -1,14 +1,12 @@ package playground -import scala.quoted._, scala.quoted.matching._ -import scala.quoted.{given _} -import scala.tasty._ +import scala.quoted._ object macros { inline def mcr(x: => Any) = ${mcrImpl('x)} def mcrImpl(body: Expr[Any])(using ctx: QuoteContext) : Expr[Any] = { - import ctx.tasty.{_, given _} + import ctx.tasty._ body.unseal match { case Block(_, _) => '{2} } } } diff --git a/tests/neg/i6762.scala b/tests/neg/i6762.scala index c653c454f06c..c5b7bc7b487a 100644 --- a/tests/neg/i6762.scala +++ b/tests/neg/i6762.scala @@ -1,4 +1,4 @@ -import scala.quoted.{_, given _} +import scala.quoted._ type G[X] case class Foo[T](x: T) diff --git a/tests/neg/i6997b.scala b/tests/neg/i6997b.scala index a3a861fce5b9..52c9ed0f9e20 100644 --- a/tests/neg/i6997b.scala +++ b/tests/neg/i6997b.scala @@ -1,6 +1,6 @@ package playground -import scala.quoted.{_, given _}, scala.quoted.matching._ +import scala.quoted._ inline def mcr(x: => Any): Any = ${mcrImpl('x)} diff --git a/tests/neg/i7048e.scala b/tests/neg/i7048e.scala index 0b9a67fad9e7..1130b1bd601b 100644 --- a/tests/neg/i7048e.scala +++ b/tests/neg/i7048e.scala @@ -1,4 +1,4 @@ -import scala.quoted.{given _, _} +import scala.quoted._ abstract class Test { type T diff --git a/tests/neg/i7618.scala b/tests/neg/i7618.scala index c8122ea007c9..47e268d1703f 100644 --- a/tests/neg/i7618.scala +++ b/tests/neg/i7618.scala @@ -1,6 +1,6 @@ package macros -import scala.quoted.{given _, _} +import scala.quoted._ enum Exp { case Num(n: Int) diff --git a/tests/neg/i7618b.scala b/tests/neg/i7618b.scala index 5467aa91d32c..fa77f75374f9 100644 --- a/tests/neg/i7618b.scala +++ b/tests/neg/i7618b.scala @@ -1,6 +1,6 @@ package macros -import scala.quoted.{given _, _} +import scala.quoted._ enum Exp { case Num(n: Int) diff --git a/tests/neg/i7698.scala b/tests/neg/i7698.scala index f171b2a0b84f..c3e2800cdfce 100644 --- a/tests/neg/i7698.scala +++ b/tests/neg/i7698.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.quoted.matching._ trait Show[T] { def show(x: T): String diff --git a/tests/neg/toexproftuple.scala b/tests/neg/toexproftuple.scala index 42ce624f2205..70b7a0f2ba57 100644 --- a/tests/neg/toexproftuple.scala +++ b/tests/neg/toexproftuple.scala @@ -1,5 +1,4 @@ import scala.quoted._, scala.deriving._ -import scala.quoted.{given _} inline def mcr: Any = ${mcrImpl} def mcrImpl(using ctx: QuoteContext): Expr[Any] = { diff --git a/tests/pos-macros/i7011/Macros_1.scala b/tests/pos-macros/i7011/Macros_1.scala index d5221b664283..f2a10babf8ca 100644 --- a/tests/pos-macros/i7011/Macros_1.scala +++ b/tests/pos-macros/i7011/Macros_1.scala @@ -1,5 +1,4 @@ -import scala.quoted._, scala.quoted.matching._ -import scala.quoted.{given _} +import scala.quoted._ inline def mcr(body: => Any): Unit = ${mcrImpl('body)} diff --git a/tests/pos-macros/treemap-unapply/Macro.scala b/tests/pos-macros/treemap-unapply/Macro.scala index 9e38b1c5cff4..defd3cb29eca 100644 --- a/tests/pos-macros/treemap-unapply/Macro.scala +++ b/tests/pos-macros/treemap-unapply/Macro.scala @@ -1,4 +1,4 @@ -import scala.quoted.{ given _, _ } +import scala.quoted._ inline def mcr(x: => Unit): Unit = ${mcrImpl('x)} def mcrImpl(x: Expr[Unit])(using ctx: QuoteContext) : Expr[Unit] = diff --git a/tests/pos/i6997c.scala b/tests/pos/i6997c.scala index bdf2f361aa0a..8be7ca309ef6 100644 --- a/tests/pos/i6997c.scala +++ b/tests/pos/i6997c.scala @@ -1,6 +1,6 @@ package playground -import scala.quoted.{_, given _}, scala.quoted.matching._ +import scala.quoted._ inline def mcr(x: => Any): Any = ${mcrImpl('x)} diff --git a/tests/pos/i7048e.scala b/tests/pos/i7048e.scala index a516faf24990..145f88b5301e 100644 --- a/tests/pos/i7048e.scala +++ b/tests/pos/i7048e.scala @@ -1,4 +1,4 @@ -import scala.quoted.{given _, _} +import scala.quoted._ abstract class Test { type T diff --git a/tests/pos/i8651b.scala b/tests/pos/i8651b.scala index b4fc26663cbd..2ee40e81acc5 100644 --- a/tests/pos/i8651b.scala +++ b/tests/pos/i8651b.scala @@ -5,8 +5,6 @@ abstract class Coroutine[+T] { object Macros { import scala.quoted._ - import scala.quoted.matching._ - inline def coroutine[T](inline body: Any): Coroutine[T] = ${ coroutineImpl('{body}) } diff --git a/tests/pos/quoted-pattern-type.scala b/tests/pos/quoted-pattern-type.scala index 144d3f68b0ed..5fdffbf35d07 100644 --- a/tests/pos/quoted-pattern-type.scala +++ b/tests/pos/quoted-pattern-type.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.tasty.Reflection object Lib { diff --git a/tests/pos/scala2-macro-compat-1.scala b/tests/pos/scala2-macro-compat-1.scala index 99050d9018e2..cb74809bb0b3 100644 --- a/tests/pos/scala2-macro-compat-1.scala +++ b/tests/pos/scala2-macro-compat-1.scala @@ -20,7 +20,7 @@ object LineNumberMacro2 { object LineNumberMacro3 { import scala.quoted._ def thisLineNumberExpr(using qctx: QuoteContext): Expr[Int] = { - import qctx.tasty.{_, given _} + import qctx.tasty._ Expr(rootPosition.startLine + 1) } } diff --git a/tests/pos/toexproftuple.scala b/tests/pos/toexproftuple.scala index 1d72473e11a2..8d774148da03 100644 --- a/tests/pos/toexproftuple.scala +++ b/tests/pos/toexproftuple.scala @@ -1,5 +1,4 @@ import scala.quoted._, scala.deriving._ -import scala.quoted.{given _} inline def mcr: Any = ${mcrImpl} def mcrImpl(using ctx: QuoteContext): Expr[Any] = { diff --git a/tests/run-macros/i6765-b/Macro_1.scala b/tests/run-macros/i6765-b/Macro_1.scala index 462f343b82da..691971dc5bc4 100644 --- a/tests/run-macros/i6765-b/Macro_1.scala +++ b/tests/run-macros/i6765-b/Macro_1.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.quoted.{given _} inline def foo = ${fooImpl} diff --git a/tests/run-macros/i6765-c/Macro_1.scala b/tests/run-macros/i6765-c/Macro_1.scala index 75e6159d8942..3a1858cc56ca 100644 --- a/tests/run-macros/i6765-c/Macro_1.scala +++ b/tests/run-macros/i6765-c/Macro_1.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.quoted.{given _} inline def foo(inline n: Int) = ${fooImpl('n)} diff --git a/tests/run-macros/i6765/Macro_1.scala b/tests/run-macros/i6765/Macro_1.scala index 08d24fb6add6..7bab622bb91f 100644 --- a/tests/run-macros/i6765/Macro_1.scala +++ b/tests/run-macros/i6765/Macro_1.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.quoted.{given _} inline def foo = ${fooImpl} diff --git a/tests/run-macros/i7008/macro_1.scala b/tests/run-macros/i7008/macro_1.scala index 856b943d526d..a7946261b144 100644 --- a/tests/run-macros/i7008/macro_1.scala +++ b/tests/run-macros/i7008/macro_1.scala @@ -1,6 +1,4 @@ -import scala.quoted._, scala.quoted.matching._ -import scala.quoted.{given _} -import scala.tasty._ +import scala.quoted._ case class Box[T](v: T) diff --git a/tests/run-macros/i7715/Macros_1.scala b/tests/run-macros/i7715/Macros_1.scala index 990fc203ac35..81f733f924e4 100644 --- a/tests/run-macros/i7715/Macros_1.scala +++ b/tests/run-macros/i7715/Macros_1.scala @@ -1,4 +1,4 @@ -import scala.quoted.{ given _, _ } +import scala.quoted._ inline def mcr(e: => Any): Any = ${mcrImpl('e)} def mcrImpl(e: Expr[Any])(using ctx: QuoteContext): Expr[Any] = 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 6b08105a1bd9..1d9c13ad8bbe 100644 --- a/tests/run-macros/quote-matching-optimize-2/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-2/Macro_1.scala @@ -1,8 +1,6 @@ import scala.quoted._ import scala.quoted.autolift -import scala.tasty.Reflection - object Macro { inline def optimize[T](inline x: T): Any = ${ Macro.impl('x) } 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 a72924eb1dd4..90f4320fa761 100644 --- a/tests/run-macros/quote-matching-optimize-3/Macro_1.scala +++ b/tests/run-macros/quote-matching-optimize-3/Macro_1.scala @@ -1,8 +1,6 @@ import scala.quoted._ import scala.quoted.autolift -import scala.tasty.Reflection - object Macro { inline def optimize[T](inline x: T): Any = ${ Macro.impl('x) } diff --git a/tests/run-macros/quote-toExprOfSeq/Macro_1.scala b/tests/run-macros/quote-toExprOfSeq/Macro_1.scala index 5483aaedef1f..8afc6c8dc3d7 100644 --- a/tests/run-macros/quote-toExprOfSeq/Macro_1.scala +++ b/tests/run-macros/quote-toExprOfSeq/Macro_1.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.quoted.{given _} inline def seq = ${fooImpl} diff --git a/tests/run-macros/tasty-tree-map/quoted_1.scala b/tests/run-macros/tasty-tree-map/quoted_1.scala index 05ebc0e7f86c..de2381cae8cd 100644 --- a/tests/run-macros/tasty-tree-map/quoted_1.scala +++ b/tests/run-macros/tasty-tree-map/quoted_1.scala @@ -5,7 +5,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] = { - import qctx.tasty.{_, given _} + import qctx.tasty.{_, given _} // FIXME: #8919 val identityMap = new TreeMap { } val transformed = identityMap.transformTerm(x.unseal).seal.cast[T] transformed diff --git a/tests/run-staging/i6992/Macro_1.scala b/tests/run-staging/i6992/Macro_1.scala index 72f98106e009..62c1dbcea807 100644 --- a/tests/run-staging/i6992/Macro_1.scala +++ b/tests/run-staging/i6992/Macro_1.scala @@ -1,7 +1,6 @@ -import scala.quoted._, scala.quoted.matching._ +import scala.quoted._ import scala.quoted.staging._ -import scala.quoted.{given _} given Toolbox = Toolbox.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-function-applied-to.scala b/tests/run-staging/quote-function-applied-to.scala index 8759424d33bc..2aa204d6e2b0 100644 --- a/tests/run-staging/quote-function-applied-to.scala +++ b/tests/run-staging/quote-function-applied-to.scala @@ -1,5 +1,4 @@ import scala.quoted._ -import scala.quoted.{given _} import scala.quoted.staging._ object Test {