Skip to content

Commit 09e7e47

Browse files
Merge pull request #6776 from dotty-staging/fix-#6754
Fix #6754: Reify quotes of level 2 in `scala.quoted.run`
2 parents e2f4070 + cf4c20f commit 09e7e47

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

compiler/src/dotty/tools/dotc/quoted/QuoteCompiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import dotty.tools.dotc.core.Symbols.defn
1515
import dotty.tools.dotc.core.Types.ExprType
1616
import dotty.tools.dotc.core.quoted.PickledQuotes
1717
import dotty.tools.dotc.tastyreflect.ReflectionImpl
18-
import dotty.tools.dotc.transform.Staging
18+
import dotty.tools.dotc.transform.ReifyQuotes
1919
import dotty.tools.dotc.util.Spans.Span
2020
import dotty.tools.dotc.util.SourceFile
2121
import dotty.tools.io.{Path, VirtualFile}
@@ -36,7 +36,7 @@ class QuoteCompiler extends Compiler {
3636
List(List(new QuotedFrontend))
3737

3838
override protected def picklerPhases: List[List[Phase]] =
39-
List(List(new Staging))
39+
List(List(new ReifyQuotes))
4040

4141
override def newRun(implicit ctx: Context): ExprRun = {
4242
reset()

tests/run-with-compiler/i6754.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
foo
2+
bar

tests/run-with-compiler/i6754.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
import scala.quoted._
3+
4+
object Test {
5+
implicit val tbx: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
6+
7+
def main(args: Array[String]): Unit = {
8+
val y: Expr[Unit] = '{
9+
val x: Expr[Unit] = '{println("bar")}
10+
println("foo")
11+
x.run
12+
}
13+
y.run
14+
}
15+
}

0 commit comments

Comments
 (0)