Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,14 @@ object desugar {
trees foreach collect
case Block(Nil, expr) =>
collect(expr)
case Quote(expr) =>
new TreeTraverser {
def traverse(tree: untpd.Tree)(implicit ctx: Context): Unit = tree match {
case Splice(expr) => collect(expr)
case TypSplice(expr) => collect(expr)
case _ => traverseChildren(tree)
}
}.traverse(expr)
case _ =>
}
collect(tree)
Expand Down
12 changes: 12 additions & 0 deletions tests/pos/i6435.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Foo {
import scala.quoted._
import scala.quoted.matching._
def f(sc: quoted.Expr[StringContext]) given tasty.Reflection: Unit = {

val '{ StringContext(${parts}: _*) } = sc
val ps0: Expr[Seq[String]] = parts

val '{ StringContext(${ExprSeq(parts2)}: _*) } = sc
val ps: Seq[Expr[String]] = parts2
}
}