Skip to content

Move Staging phase after Inlining #11593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Compiler {
List(new semanticdb.ExtractSemanticDB) :: // Extract info into .semanticdb files
List(new PostTyper) :: // Additional checks and cleanups after type checking
List(new sjs.PrepJSInterop) :: // Additional checks and transformations for Scala.js (Scala.js only)
List(new Staging) :: // Check PCP, heal quoted types and expand macros
List(new sbt.ExtractAPI) :: // Sends a representation of the API of classes to sbt via callbacks
List(new SetRootTree) :: // Set the `rootTreeOrProvider` on class symbols
Nil
Expand All @@ -51,6 +50,7 @@ class Compiler {
protected def picklerPhases: List[List[Phase]] =
List(new Pickler) :: // Generate TASTY info
List(new Inlining) :: // Inline and execute macros
List(new Staging) :: // Check staging levels and heal staged types
List(new PickleQuotes) :: // Turn quoted trees into explicit run-time data structures
Nil

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/Staging.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Staging extends MacroTransform {

override def phaseName: String = Staging.name

override def runsAfter: Set[String] = Set(PostTyper.name)
override def runsAfter: Set[String] = Set(Inlining.name)

override def allowsImplicitSearch: Boolean = true

Expand Down
1 change: 0 additions & 1 deletion compiler/src/dotty/tools/repl/ReplCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class ReplCompiler extends Compiler {
List(new REPLFrontEnd),
List(new CollectTopLevelImports),
List(new PostTyper),
List(new Staging),
)

def newRun(initCtx: Context, state: State): Run = new Run(this, initCtx) {
Expand Down
3 changes: 2 additions & 1 deletion staging/src/scala/quoted/staging/QuoteCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import dotty.tools.dotc.core.Symbols._
import dotty.tools.dotc.core.Types.ExprType
import dotty.tools.dotc.quoted.PickledQuotes
import dotty.tools.dotc.transform.Splicer.checkEscapedVariables
import dotty.tools.dotc.transform.{Inlining, PickleQuotes}
import dotty.tools.dotc.transform.{Inlining, Staging, PickleQuotes}
import dotty.tools.dotc.util.Spans.Span
import dotty.tools.dotc.util.{SourceFile, NoSourcePosition}
import dotty.tools.io.{Path, VirtualFile}
Expand All @@ -40,6 +40,7 @@ private class QuoteCompiler extends Compiler:

override protected def picklerPhases: List[List[Phase]] =
List(new Inlining) ::
List(new Staging) ::
List(new PickleQuotes) ::
Nil

Expand Down