Skip to content

Commit ea48d0b

Browse files
committed
Fix tests
Move checker before ExpandSAMs: - inner classes are more complex to deal with - the trees are not set for the synthesized class
1 parent 2801664 commit ea48d0b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Compiler {
5757

5858
/** Phases dealing with the transformation from pickled trees to backend trees */
5959
protected def transformPhases: List[List[Phase]] =
60+
List(new init.Checker) :: // Check initialization of objects
6061
List(new FirstTransform, // Some transformations to put trees into a canonical form
6162
new CheckReentrant, // Internal use only: Check that compiled program has no data races involving global vars
6263
new ElimPackagePrefixes, // Eliminate references to package prefixes in Select nodes
@@ -65,7 +66,6 @@ class Compiler {
6566
new BetaReduce, // Reduce closure applications
6667
new InlineVals, // Check right hand-sides of an `inline val`s
6768
new ExpandSAMs) :: // Expand single abstract method closures to anonymous classes
68-
List(new init.Checker) :: // Check initialization of objects
6969
List(new ElimRepeated, // Rewrite vararg parameters and arguments
7070
new ProtectedAccessors, // Add accessors for protected members
7171
new ExtensionMethods, // Expand methods of value classes with extension methods

compiler/src/dotty/tools/dotc/transform/init/Checker.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Checker extends Phase {
2929
private val cycleChecker = new CycleChecker(cache)
3030

3131
override val runsAfter = Set(Pickler.name)
32+
val runsBefore = Set(ExpandSAMs.name)
3233

3334
override def isEnabled(using Context): Boolean =
3435
super.isEnabled && ctx.settings.YcheckInit.value

0 commit comments

Comments
 (0)