Skip to content

Commit f72eee0

Browse files
committed
move ExtractAPI after RefChecks
We need to make sure RefChecks run before ExtractAPI, as there might be cyclic reference exceptions. See neg/i1750.scala.
1 parent 714a8d7 commit f72eee0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class Compiler {
4444
List(new FrontEnd), // Compiler frontend: scanner, parser, namer, typer
4545
List(new sbt.ExtractDependencies), // Sends information on classes' dependencies to sbt via callbacks
4646
List(new PostTyper), // Additional checks and cleanups after type checking
47-
List(new sbt.ExtractAPI), // Sends a representation of the API of classes to sbt via callbacks
4847
List(new Pickler), // Generate TASTY info
4948
List(new FirstTransform, // Some transformations to put trees into a canonical form
5049
new CheckReentrant), // Internal use only: Check that compiled program has no data races involving global vars
@@ -57,6 +56,7 @@ class Compiler {
5756
new TailRec, // Rewrite tail recursion to loops
5857
new LiftTry, // Put try expressions that might execute on non-empty stacks into their own methods
5958
new ClassOf), // Expand `Predef.classOf` calls.
59+
List(new sbt.ExtractAPI), // Sends a representation of the API of classes to sbt via callbacks
6060
List(new TryCatchPatterns, // Compile cases in try/catch
6161
new PatternMatcher, // Compile pattern matches
6262
new ExplicitOuter, // Add accessors to outer classes from nested ones.

compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ExtractAPI extends Phase {
3535
// after `PostTyper` (unlike `ExtractDependencies`, the simplication to trees
3636
// done by `PostTyper` do not affect this phase because it only cares about
3737
// definitions, and `PostTyper` does not change definitions).
38-
override def runsAfter = Set(classOf[transform.PostTyper])
38+
override def runsAfter = Set(classOf[transform.PostTyper], classOf[typer.RefChecks])
3939

4040
override def run(implicit ctx: Context): Unit = {
4141
val unit = ctx.compilationUnit

0 commit comments

Comments
 (0)