We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36f9133 commit 4ae76f2Copy full SHA for 4ae76f2
compiler/src/dotty/tools/dotc/core/Phases.scala
@@ -26,7 +26,10 @@ trait Phases {
26
27
def phasesStack: List[Phase] =
28
if ((this eq NoContext) || !phase.exists) Nil
29
- else phase :: outersIterator.dropWhile(_.phase == phase).next.phasesStack
+ else {
30
+ val rest = outersIterator.dropWhile(_.phase == phase)
31
+ phase :: (if (rest.hasNext) rest.next.phasesStack else Nil)
32
+ }
33
34
/** Execute `op` at given phase */
35
def atPhase[T](phase: Phase)(op: Context => T): T =
0 commit comments