Closed
Description
The following works
import scala.quoted._
import scala.quoted.matching._
def f(sc: quoted.Expr[StringContext]) given tasty.Reflection: Unit = {
sc match {
case '{ StringContext(${ExprSeq(parts)}: _*) } =>
val ps: Seq[Expr[String]] = parts
}
}
but rewiting it to
import scala.quoted._
import scala.quoted.matching._
def f(sc: quoted.Expr[StringContext]) given tasty.Reflection: Unit = {
val '{ StringContext(${ExprSeq(parts)}: _*) } = sc
val ps: Seq[Expr[String]] = parts
}
fails with
15 | val ps: Seq[Expr[String]] = parts
| ^^^^^
| Not found: parts