Skip to content

Commit e3a3974

Browse files
Merge pull request #11593 from dotty-staging/move-staging-phase-after-inlining
Move Staging phase after Inlining
2 parents 0909982 + cea49cf commit e3a3974

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class Compiler {
4242
List(new semanticdb.ExtractSemanticDB) :: // Extract info into .semanticdb files
4343
List(new PostTyper) :: // Additional checks and cleanups after type checking
4444
List(new sjs.PrepJSInterop) :: // Additional checks and transformations for Scala.js (Scala.js only)
45-
List(new Staging) :: // Check PCP, heal quoted types and expand macros
4645
List(new sbt.ExtractAPI) :: // Sends a representation of the API of classes to sbt via callbacks
4746
List(new SetRootTree) :: // Set the `rootTreeOrProvider` on class symbols
4847
Nil
@@ -51,6 +50,7 @@ class Compiler {
5150
protected def picklerPhases: List[List[Phase]] =
5251
List(new Pickler) :: // Generate TASTY info
5352
List(new Inlining) :: // Inline and execute macros
53+
List(new Staging) :: // Check staging levels and heal staged types
5454
List(new PickleQuotes) :: // Turn quoted trees into explicit run-time data structures
5555
Nil
5656

compiler/src/dotty/tools/dotc/transform/Staging.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Staging extends MacroTransform {
3535

3636
override def phaseName: String = Staging.name
3737

38-
override def runsAfter: Set[String] = Set(PostTyper.name)
38+
override def runsAfter: Set[String] = Set(Inlining.name)
3939

4040
override def allowsImplicitSearch: Boolean = true
4141

compiler/src/dotty/tools/repl/ReplCompiler.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class ReplCompiler extends Compiler {
3535
List(new REPLFrontEnd),
3636
List(new CollectTopLevelImports),
3737
List(new PostTyper),
38-
List(new Staging),
3938
)
4039

4140
def newRun(initCtx: Context, state: State): Run = new Run(this, initCtx) {

staging/src/scala/quoted/staging/QuoteCompiler.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import dotty.tools.dotc.core.Symbols._
1616
import dotty.tools.dotc.core.Types.ExprType
1717
import dotty.tools.dotc.quoted.PickledQuotes
1818
import dotty.tools.dotc.transform.Splicer.checkEscapedVariables
19-
import dotty.tools.dotc.transform.{Inlining, PickleQuotes}
19+
import dotty.tools.dotc.transform.{Inlining, Staging, PickleQuotes}
2020
import dotty.tools.dotc.util.Spans.Span
2121
import dotty.tools.dotc.util.{SourceFile, NoSourcePosition}
2222
import dotty.tools.io.{Path, VirtualFile}
@@ -40,6 +40,7 @@ private class QuoteCompiler extends Compiler:
4040

4141
override protected def picklerPhases: List[List[Phase]] =
4242
List(new Inlining) ::
43+
List(new Staging) ::
4344
List(new PickleQuotes) ::
4445
Nil
4546

0 commit comments

Comments
 (0)