Skip to content

Commit 869b9bd

Browse files
committed
Rename Exprs to Varargs
1 parent 667f3e4 commit 869b9bd

File tree

25 files changed

+49
-49
lines changed

25 files changed

+49
-49
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,9 @@ These could be used in the following way to optimize any call to `sum` that has
624624
```scala
625625
inline def sum(inline args: Int*): Int = ${ sumExpr('args) }
626626
private def sumExpr(argsExpr: Expr[Seq[Int]])(using QuoteContext): Expr[Int] = argsExpr match {
627-
case Exprs(Const(args)) => // args is of type Seq[Int]
627+
case Varargs(Const(args)) => // args is of type Seq[Int]
628628
Expr(args.sum) // precompute result of sum
629-
case Exprs(argExprs) => // argExprs is of type Seq[Expr[Int]]
629+
case Varargs(argExprs) => // argExprs is of type Seq[Expr[Int]]
630630
val staticSum: Int = argExprs.map {
631631
case Const(arg) => arg
632632
case _ => 0
@@ -662,12 +662,12 @@ private def optimizeExpr(body: Expr[Int])(using QuoteContext): Expr[Int] = body
662662
// Match a call to sum with an argument $n of type Int. n will be the Expr[Int] representing the argument.
663663
case '{ sum($n) } => n
664664
// Match a call to sum and extracts all its args in an `Expr[Seq[Int]]`
665-
case '{ sum(${Exprs(args)}: _*) } => sumExpr(args)
665+
case '{ sum(${Varargs(args)}: _*) } => sumExpr(args)
666666
case body => body
667667
}
668668
private def sumExpr(args1: Seq[Expr[Int]])(using QuoteContext): Expr[Int] = {
669669
def flatSumArgs(arg: Expr[Int]): Seq[Expr[Int]] = arg match {
670-
case '{ sum(${Exprs(subArgs)}: _*) } => subArgs.flatMap(flatSumArgs)
670+
case '{ sum(${Varargs(subArgs)}: _*) } => subArgs.flatMap(flatSumArgs)
671671
case arg => Seq(arg)
672672
}
673673
val args2 = args1.flatMap(flatSumArgs)
@@ -705,7 +705,7 @@ inline def (sc: StringContext).showMe(inline args: Any*): String = ${ showMeExpr
705705

706706
private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using qctx: QuoteContext): Expr[String] = {
707707
argsExpr match {
708-
case Exprs(argExprs) =>
708+
case Varargs(argExprs) =>
709709
val argShowedExprs = argExprs.map {
710710
case '{ $arg: $tp } =>
711711
val showTp = '[Show[$tp]]
@@ -714,7 +714,7 @@ private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using
714714
case None => qctx.error(s"could not find implicit for ${showTp.show}", arg); '{???}
715715
}
716716
}
717-
val newArgsExpr = Exprs(argShowedExprs)
717+
val newArgsExpr = Varargs(argShowedExprs)
718718
'{ $sc.s($newArgsExpr: _*) }
719719
case _ =>
720720
// `new StringContext(...).showMeExpr(args: _*)` not an explicit `showMeExpr"..."`

library/src-bootstrapped/dotty/internal/StringContextMacro.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ object StringContextMacro {
6464
def notStatic =
6565
qctx.throwError("Expected statically known String Context", strCtxExpr)
6666
def splitParts(seq: Expr[Seq[String]]) = seq match {
67-
case Exprs(p1) =>
67+
case Varargs(p1) =>
6868
p1 match
6969
case Const(p2) => (p1.toList, p2.toList)
7070
case _ => notStatic
@@ -77,7 +77,7 @@ object StringContextMacro {
7777
}
7878

7979
val args = argsExpr match {
80-
case Exprs(args) => args
80+
case Varargs(args) => args
8181
case _ => qctx.throwError("Expected statically known argument list", argsExpr)
8282
}
8383

library/src/scala/quoted/Const.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object Const {
3232
* ```scala
3333
* inline def sum(args: Int*): Int = ${ sumExpr('args) }
3434
* def sumExpr(argsExpr: Expr[Seq[Int]])(usingusing QuoteContext): Expr[Int] = argsExpr match
35-
* case Exprs(Const(args)) =>
35+
* case Varargs(Const(args)) =>
3636
* // args: Seq[Int]
3737
* ...
3838
* }

library/src/scala/quoted/Expr.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ object Expr {
110110
* `'{ Seq($e1, $e2, ...) }` typed as an `Expr[Seq[T]]`
111111
* ```
112112
*/
113-
def ofSeq[T](xs: Seq[Expr[T]])(using tp: Type[T], qctx: QuoteContext): Expr[Seq[T]] = Exprs(xs)
113+
def ofSeq[T](xs: Seq[Expr[T]])(using tp: Type[T], qctx: QuoteContext): Expr[Seq[T]] = Varargs(xs)
114114

115115
/** Lifts this list of expressions into an expression of a list
116116
*
@@ -120,7 +120,7 @@ object Expr {
120120
* `'{ List($e1, $e2, ...) }` typed as an `Expr[List[T]]`
121121
*/
122122
def ofList[T](xs: Seq[Expr[T]])(using Type[T], QuoteContext): Expr[List[T]] =
123-
if (xs.isEmpty) '{ Nil } else '{ List(${Exprs(xs)}: _*) }
123+
if (xs.isEmpty) '{ Nil } else '{ List(${Varargs(xs)}: _*) }
124124

125125
/** Lifts this sequence of expressions into an expression of a tuple
126126
*
@@ -178,7 +178,7 @@ object Expr {
178178
case Seq('{ $x1: $t1 }, '{ $x2: $t2 }, '{ $x3: $t3 }, '{ $x4: $t4 }, '{ $x5: $t5 }, '{ $x6: $t6 }, '{ $x7: $t7 }, '{ $x8: $t8 }, '{ $x9: $t9 }, '{ $x10: $t10 }, '{ $x11: $t11 }, '{ $x12: $t12 }, '{ $x13: $t13 }, '{ $x14: $t14 }, '{ $x15: $t15 }, '{ $x16: $t16 }, '{ $x17: $t17 }, '{ $x18: $t18 }, '{ $x19: $t19 }, '{ $x20: $t20 }, '{ $x21: $t21 }, '{ $x22: $t22 }) =>
179179
'{ Tuple22($x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x16, $x17, $x18, $x19, $x20, $x21, $x22) }
180180
case _ =>
181-
'{ Tuple.fromIArray(IArray(${Exprs(seq)}: _*)) }
181+
'{ Tuple.fromIArray(IArray(${Varargs(seq)}: _*)) }
182182
}
183183
}
184184

library/src/scala/quoted/Value.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object Value {
2121
* ```scala
2222
* inline def sum(args: Int*): Int = ${ sumExpr('args) }
2323
* def sumExpr(argsExpr: Expr[Seq[Int]])(using QuoteContext): Expr[Int] = argsExpr match
24-
* case Exprs(Value(args)) =>
24+
* case Varargs(Value(args)) =>
2525
* // args: Seq[Int]
2626
* ...
2727
* }

library/src/scala/quoted/ValueOfExpr.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ object ValueOfExpr {
4242

4343
given StringContext_delegate as ValueOfExpr[StringContext] = new {
4444
def apply(x: Expr[StringContext])(using qctx: QuoteContext): Option[StringContext] = x match {
45-
case '{ new StringContext(${Exprs(Const(args))}: _*) } => Some(StringContext(args: _*))
46-
case '{ StringContext(${Exprs(Const(args))}: _*) } => Some(StringContext(args: _*))
45+
case '{ new StringContext(${Varargs(Const(args))}: _*) } => Some(StringContext(args: _*))
46+
case '{ StringContext(${Varargs(Const(args))}: _*) } => Some(StringContext(args: _*))
4747
case _ => None
4848
}
4949
override def toString(): String = "scala.quoted.ValueOfExpr.Tuple1_delegate"
@@ -270,9 +270,9 @@ object ValueOfExpr {
270270

271271
given Seq_delegate[T](using Type[T], ValueOfExpr[T]) as ValueOfExpr[Seq[T]] = new {
272272
def apply(x: Expr[Seq[T]])(using qctx: QuoteContext): Option[Seq[T]] = x match {
273-
case Exprs(Value(elems)) => Some(elems)
274-
case '{ scala.collection.Seq[T](${Exprs(Value(elems))}: _*) } => Some(elems)
275-
case '{ scala.collection.immutable.Seq[T](${Exprs(Value(elems))}: _*) } => Some(elems)
273+
case Varargs(Value(elems)) => Some(elems)
274+
case '{ scala.collection.Seq[T](${Varargs(Value(elems))}: _*) } => Some(elems)
275+
case '{ scala.collection.immutable.Seq[T](${Varargs(Value(elems))}: _*) } => Some(elems)
276276
case _ => None
277277
}
278278
override def toString(): String = "scala.quoted.ValueOfExpr.Seq_delegate"

library/src/scala/quoted/Exprs.scala renamed to library/src/scala/quoted/Varargs.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scala.quoted
22

33
/** Literal sequence of expressions */
4-
object Exprs {
4+
object Varargs {
55

66
/** Lifts this sequence of expressions into an expression of a sequence
77
*
@@ -12,7 +12,7 @@ object Exprs {
1212
*
1313
* Usage:
1414
* ```scala
15-
* '{ List(${Exprs(List(1, 2, 3))}: _*) } // equvalent to '{ List(1, 2, 3) }
15+
* '{ List(${Varargs(List(1, 2, 3))}: _*) } // equvalent to '{ List(1, 2, 3) }
1616
* ```
1717
*/
1818
def apply[T](xs: Seq[Expr[T]])(using tp: Type[T], qctx: QuoteContext): Expr[Seq[T]] = {
@@ -26,8 +26,8 @@ object Exprs {
2626
* ```scala
2727
* inline def sum(args: Int*): Int = ${ sumExpr('args) }
2828
* def sumExpr(argsExpr: Expr[Seq[Int]])(using QuoteContext): Expr[Int] = argsExpr match
29-
* case Exprs(argExprs) =>
30-
* // argExprs: Seq[Expr[Int]]
29+
* case Varargs(argVarargs) =>
30+
* // argVarargs: Seq[Expr[Int]]
3131
* ...
3232
* }
3333
* ```

library/src/scala/quoted/matching/ConstSeq.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ object ConstSeq {
1616
* }
1717
* ```
1818
*/
19-
@deprecated("use scala.quoted.Exprs(scala.quoted.Const(_)) instead", "0.23.0")
19+
@deprecated("use scala.quoted.Varargs(scala.quoted.Const(_)) instead", "0.23.0")
2020
def unapply[T](expr: Expr[Seq[T]])(using qctx: QuoteContext): Option[Seq[T]] =
2121
import scala.quoted.Const
2222
expr match
23-
case Exprs(Const(elems)) => Some(elems)
23+
case Varargs(Const(elems)) => Some(elems)
2424
case _ => None
2525

2626
}

library/src/scala/quoted/matching/ValueSeq.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ object ValueSeq {
1616
* }
1717
* ```
1818
*/
19-
@deprecated("use scala.quoted.Exprs(scala.quoted.Value(_)) instead", "0.23.0")
19+
@deprecated("use scala.quoted.Varargs(scala.quoted.Value(_)) instead", "0.23.0")
2020
def unapply[T](expr: Expr[Seq[T]])(using valueOf: ValueOfExpr[T], qctx: QuoteContext): Option[Seq[T]] =
2121
import scala.quoted.Const
2222
expr match
23-
case Exprs(Value(elems)) => Some(elems)
23+
case Varargs(Value(elems)) => Some(elems)
2424
case _ => None
2525

2626
}

library/src/scala/quoted/matching/package.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ package object matching {
1717
@deprecated("use scala.quoted.Const instead", "0.23.0")
1818
val Const: quoted.Const.type = quoted.Const
1919

20-
@deprecated("use scala.quoted.Exprs instead", "0.23.0")
21-
val ExprSeq: quoted.Exprs.type = quoted.Exprs
20+
@deprecated("use scala.quoted.Varargs instead", "0.23.0")
21+
val ExprSeq: quoted.Varargs.type = quoted.Varargs
2222

2323
@deprecated("use scala.quoted.Lambda instead", "0.23.0")
2424
val Lambda: quoted.Lambda.type = quoted.Lambda

tests/neg-macros/i6432/Macro_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object Macro {
99
def impl(sc: Expr[StringContext])(using qctx: QuoteContext) : Expr[Unit] = {
1010
import qctx.tasty._
1111
sc match {
12-
case '{ StringContext(${Exprs(parts)}: _*) } =>
12+
case '{ StringContext(${Varargs(parts)}: _*) } =>
1313
for (part @ Const(s) <- parts)
1414
error(s, part.unseal.pos)
1515
}

tests/neg-macros/i6432b/Macro_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object Macro {
99
def impl(sc: Expr[StringContext])(using qctx: QuoteContext) : Expr[Unit] = {
1010
import qctx.tasty._
1111
sc match {
12-
case '{ StringContext(${Exprs(parts)}: _*) } =>
12+
case '{ StringContext(${Varargs(parts)}: _*) } =>
1313
for (part @ Const(s) <- parts)
1414
error(s, part.unseal.pos)
1515
}

tests/neg/i6436.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- Error: tests/neg/i6436.scala:5:9 ------------------------------------------------------------------------------------
2-
5 | case '{ StringContext(${Exprs(parts)}: _*) } => // error
3-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2+
5 | case '{ StringContext(${Varargs(parts)}: _*) } => // error
3+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
| no implicit argument of type scala.quoted.QuoteContext was found
55
-- [E006] Unbound Identifier Error: tests/neg/i6436.scala:6:34 ---------------------------------------------------------
66
6 | val ps: Seq[Expr[String]] = parts // error

tests/neg/i6436.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
def f(sc: quoted.Expr[StringContext]): Unit = {
44
sc match {
5-
case '{ StringContext(${Exprs(parts)}: _*) } => // error
5+
case '{ StringContext(${Varargs(parts)}: _*) } => // error
66
val ps: Seq[Expr[String]] = parts // error
77
}
88
}

tests/pos/i6435.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Foo {
66
val '{ StringContext(${parts}: _*) } = sc
77
val ps0: Expr[Seq[String]] = parts
88

9-
val '{ StringContext(${Exprs(parts2)}: _*) } = sc
9+
val '{ StringContext(${Varargs(parts2)}: _*) } = sc
1010
val ps: Seq[Expr[String]] = parts2
1111
}
1212
}

tests/run-macros/f-interpolator-neg/Macros_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ object Macro {
1414

1515
def fooErrors(strCtxExpr: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using QuoteContext): Expr[List[(Boolean, Int, Int, Int, String)]] = {
1616
(strCtxExpr, argsExpr) match {
17-
case ('{ StringContext(${Exprs(parts)}: _*) }, Exprs(args)) =>
17+
case ('{ StringContext(${Varargs(parts)}: _*) }, Varargs(args)) =>
1818
fooErrorsImpl(parts, args, argsExpr)
19-
case ('{ new StringContext(${Exprs(parts)}: _*) }, Exprs(args)) =>
19+
case ('{ new StringContext(${Varargs(parts)}: _*) }, Varargs(args)) =>
2020
fooErrorsImpl(parts, args, argsExpr)
2121
}
2222
}

tests/run-macros/i7008/macro_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ def mcrProxy(expr: Expr[Boolean])(using QuoteContext): Expr[Unit] = {
1414

1515
def mcrImpl[T](func: Expr[Seq[Box[T]] => Unit], expr: Expr[T])(using ctx: QuoteContext, tt: Type[T]): Expr[Unit] = {
1616
import ctx.tasty._
17-
val arg = Exprs(Seq('{(Box($expr))}))
17+
val arg = Varargs(Seq('{(Box($expr))}))
1818
Expr.betaReduce(func)(arg)
1919
}

tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Macros {
88

99
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
1010
(self, args) match {
11-
case ('{ StringContext(${Exprs(parts)}: _*) }, Exprs(args1)) =>
11+
case ('{ StringContext(${Varargs(parts)}: _*) }, Varargs(args1)) =>
1212
val strParts = parts.map { case Const(str) => str.reverse }
1313
val strArgs = args1.map { case Const(str) => str }
1414
Expr(StringContext(strParts: _*).s(strArgs: _*))

tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Macros {
88

99
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
1010
self match {
11-
case '{ StringContext(${Exprs(Const(parts))}: _*) } =>
11+
case '{ StringContext(${Varargs(Const(parts))}: _*) } =>
1212
val upprerParts: List[String] = parts.toList.map(_.toUpperCase)
1313
val upprerPartsExpr: Expr[List[String]] = Expr.ofList(upprerParts.map(Expr(_)))
1414
'{ StringContext($upprerPartsExpr: _*).s($args: _*) }

tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Macros {
88

99
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
1010
self match {
11-
case '{ StringContext(${Exprs(parts)}: _*) } =>
11+
case '{ StringContext(${Varargs(parts)}: _*) } =>
1212
val parts2 = Expr.ofList(parts.map(x => '{ $x.reverse }))
1313
'{ StringContext($parts2: _*).s($args: _*) }
1414
case _ =>

tests/run-macros/quoted-matching-docs-2/Macro_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ private def optimizeExpr(body: Expr[Int])(using QuoteContext): Expr[Int] = body
1515
// Match a call to sum with an argument $n of type Int. n will be the Expr[Int] representing the argument.
1616
case '{ sum($n) } => n
1717
// Match a call to sum and extracts all its args in an `Expr[Seq[Int]]`
18-
case '{ sum(${Exprs(args)}: _*) } => sumExpr(args)
18+
case '{ sum(${Varargs(args)}: _*) } => sumExpr(args)
1919
case body => body
2020
}
2121

2222
private def sumExpr(args1: Seq[Expr[Int]])(using QuoteContext): Expr[Int] = {
2323
def flatSumArgs(arg: Expr[Int]): Seq[Expr[Int]] = arg match {
24-
case '{ sum(${Exprs(subArgs)}: _*) } => subArgs.flatMap(flatSumArgs)
24+
case '{ sum(${Varargs(subArgs)}: _*) } => subArgs.flatMap(flatSumArgs)
2525
case arg => Seq(arg)
2626
}
2727
val args2 = args1.flatMap(flatSumArgs)

tests/run-macros/quoted-matching-docs/Macro_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ private def sumExprShow(argsExpr: Expr[Seq[Int]]) (using QuoteContext): Expr[Str
1212
private def sumExpr(argsExpr: Expr[Seq[Int]])(using qctx: QuoteContext) : Expr[Int] = {
1313
import qctx.tasty.{given _, _}
1414
UnsafeExpr.underlyingArgument(argsExpr) match {
15-
case Exprs(Const(args)) => // args is of type Seq[Int]
15+
case Varargs(Const(args)) => // args is of type Seq[Int]
1616
Expr(args.sum) // precompute result of sum
17-
case Exprs(argExprs) => // argExprs is of type Seq[Expr[Int]]
17+
case Varargs(argExprs) => // argExprs is of type Seq[Expr[Int]]
1818
val staticSum: Int = argExprs.map {
1919
case Const(arg) => arg
2020
case _ => 0

tests/run-macros/string-context-implicits/Macro_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inline def (sc: StringContext) showMe(inline args: Any*): String = ${ showMeExpr
55

66
private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using qctx: QuoteContext): Expr[String] = {
77
argsExpr match {
8-
case Exprs(argExprs) =>
8+
case Varargs(argExprs) =>
99
val argShowedExprs = argExprs.map {
1010
case '{ $arg: $tp } =>
1111
val showTp = '[Show[$tp]]
@@ -14,7 +14,7 @@ private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using
1414
case None => qctx.error(s"could not find implicit for ${showTp.show}", arg); '{???}
1515
}
1616
}
17-
val newArgsExpr = Exprs(argShowedExprs)
17+
val newArgsExpr = Varargs(argShowedExprs)
1818
'{ $sc.s($newArgsExpr: _*) }
1919
case _ =>
2020
// `new StringContext(...).showMeExpr(args: _*)` not an explicit `showMeExpr"..."`

tests/run-macros/tasty-simplified/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ object Macros {
1919
}
2020

2121
val tps = unpackTuple(typeOf[T])
22-
Exprs(tps.map(x => Expr(x.show)))
22+
Varargs(tps.map(x => Expr(x.show)))
2323
}
2424
}

tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object Macro {
2121

2222
def foo(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using qctx: QuoteContext): Expr[String] = {
2323
(sc, argsExpr) match {
24-
case ('{ StringContext(${Exprs(parts)}: _*) }, Exprs(args)) =>
24+
case ('{ StringContext(${Varargs(parts)}: _*) }, Varargs(args)) =>
2525
val reporter = new Reporter {
2626
def errorOnPart(msg: String, partIdx: Int): Unit = {
2727
import qctx.tasty._
@@ -34,7 +34,7 @@ object Macro {
3434

3535
def fooErrors(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using qctx: QuoteContext): Expr[List[(Int, Int, Int, String)]] = {
3636
(sc, argsExpr) match {
37-
case ('{ StringContext(${Exprs(parts)}: _*) }, Exprs(args)) =>
37+
case ('{ StringContext(${Varargs(parts)}: _*) }, Varargs(args)) =>
3838
val errors = List.newBuilder[Expr[(Int, Int, Int, String)]]
3939
val reporter = new Reporter {
4040
def errorOnPart(msg: String, partIdx: Int): Unit = {

0 commit comments

Comments
 (0)