diff --git a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala index 1d8a2d6b9eee..56342322824c 100644 --- a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala +++ b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala @@ -455,11 +455,6 @@ class MegaPhase(val miniPhases: Array[MiniPhase]) extends Phase { // Initialization code - for ((phase, idx) <- miniPhases.zipWithIndex) { - phase.superPhase = this - phase.idxInGroup = idx - } - /** Class#getDeclaredMethods is slow, so we cache its output */ private val clsMethodsCache = new java.util.IdentityHashMap[Class[?], Array[java.lang.reflect.Method]] @@ -564,6 +559,11 @@ class MegaPhase(val miniPhases: Array[MiniPhase]) extends Phase { private val nxOtherPrepPhase = init("prepareForOther") private val nxOtherTransPhase = init("transformOther") + for ((phase, idx) <- miniPhases.zipWithIndex) { + phase.superPhase = this + phase.idxInGroup = idx + } + // Boilerplate snippets def prepIdent(tree: Ident, start: Int)(using Context): Context = {