File tree 3 files changed +6
-2
lines changed
src-bootstrapped/scala/quoted 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,8 @@ object FromExpr {
136
136
*/
137
137
given StringContextFromExpr : FromExpr [StringContext ] with {
138
138
def unapply (x : Expr [StringContext ])(using Quotes ) = x match {
139
- case ' { new StringContext ($ {Varargs (Consts (args))}: _* ) } => Some (StringContext (args : _* ))
140
- case ' { StringContext ($ {Varargs (Consts (args))}: _* ) } => Some (StringContext (args : _* ))
139
+ case ' { new StringContext ($ {Varargs (Exprs (args))}: _* ) } => Some (StringContext (args : _* ))
140
+ case ' { StringContext ($ {Varargs (Exprs (args))}: _* ) } => Some (StringContext (args : _* ))
141
141
case _ => None
142
142
}
143
143
}
Original file line number Diff line number Diff line change 1
1
package scala .quoted
2
2
3
3
/** Literal constant values */
4
+ @ deprecated(" Use `scala.quoted.Expr` instead. This will be removed in 3.0.0-RC1" , " 3.0.0-M3" )
4
5
object Const {
5
6
6
7
/** Matches expressions containing literal constant values and extracts the value.
@@ -18,6 +19,7 @@ object Const {
18
19
*
19
20
* To directly unlift an expression `expr: Expr[T]` consider using `expr.value`/`expr.valueOrError` insead.
20
21
*/
22
+ @ deprecated(" Use `scala.quoted.Expr.unapply` instead. This will be removed in 3.0.0-RC1" , " 3.0.0-M3" )
21
23
def unapply [T ](expr : Expr [T ])(using Quotes ): Option [T ] = {
22
24
import quotes .reflect ._
23
25
def rec (tree : Term ): Option [T ] = tree match {
Original file line number Diff line number Diff line change 1
1
package scala .quoted
2
2
3
3
/** Literal constant values */
4
+ @ deprecated(" Use `scala.quoted.Exprs` instead. This will be removed in 3.0.0-RC1" , " 3.0.0-M3" )
4
5
object Consts {
5
6
6
7
/** Matches literal sequence of literal constant value expressions and return a sequence of values.
@@ -17,6 +18,7 @@ object Consts {
17
18
*
18
19
* To directly unlift all expressions in a sequence `exprs: Seq[Expr[T]]` consider using `exprs.map(_.value)`/`exprs.map(_.valueOrError)` insead.
19
20
*/
21
+ @ deprecated(" Use `scala.quoted.Exprs.unapply` instead. This will be removed in 3.0.0-RC1" , " 3.0.0-M3" )
20
22
def unapply [T ](exprs : Seq [Expr [T ]])(using Quotes ): Option [Seq [T ]] =
21
23
exprs.foldRight(Option (List .empty[T ])) { (elem, acc) =>
22
24
(elem, acc) match {
You can’t perform that action at this time.
0 commit comments