diff --git a/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala b/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala index 76d19967e0c1..f032f8d4d065 100644 --- a/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala +++ b/compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala @@ -24,7 +24,7 @@ class ReadTasty extends Phase { withMode(Mode.ReadPositions) { val nextUnits = collection.mutable.ListBuffer.empty[CompilationUnit] val unitContexts = units.view.map(ctx.fresh.setCompilationUnit) - for given Context <- unitContexts if addTasty(nextUnits += _) do () + for unitContext <- unitContexts if addTasty(nextUnits += _)(using unitContext) do () nextUnits.toList } diff --git a/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala b/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala index d8c1f5f17adf..bcabfbd03a1d 100644 --- a/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala +++ b/compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala @@ -48,9 +48,9 @@ class Parser extends Phase { val unitContexts0 = for - given Context <- unitContexts - if parse - yield ctx + unitContext <- unitContexts + if parse(using unitContext) + yield unitContext record("parsedTrees", ast.Trees.ntrees) diff --git a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala index 32d6ec45584e..8478cefbc764 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Checker.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Checker.scala @@ -41,7 +41,7 @@ class Checker extends Phase: val unitContexts = units.map(unit => checkCtx.fresh.setCompilationUnit(unit)) val units0 = - for given Context <- unitContexts if traverse(traverser) yield ctx.compilationUnit + for unitContext <- unitContexts if traverse(traverser)(using unitContext) yield unitContext.compilationUnit cancellable { val classes = traverser.getClasses() diff --git a/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala b/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala index 210e457a7764..10796dce2e7c 100644 --- a/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala +++ b/compiler/src/dotty/tools/dotc/typer/TyperPhase.scala @@ -75,9 +75,9 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase { val unitContexts0 = try for - given Context <- unitContexts - if enterSyms - yield ctx + unitContext <- unitContexts + if enterSyms(using unitContext) + yield unitContext finally ctx.run.advanceSubPhase() // tick from "typer (indexing)" to "typer (typechecking)" @@ -94,9 +94,9 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase { val unitContexts1 = try for - given Context <- unitContexts0 - if typeCheck - yield ctx + unitContext <- unitContexts0 + if typeCheck(using unitContext) + yield unitContext finally ctx.run.advanceSubPhase() // tick from "typer (typechecking)" to "typer (java checking)" @@ -104,9 +104,9 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase { val unitContexts2 = for - given Context <- unitContexts1 - if javaCheck // after typechecking to avoid cycles - yield ctx + unitContext <- unitContexts1 + if javaCheck(using unitContext) // after typechecking to avoid cycles + yield unitContext val newUnits = unitContexts2.map(_.compilationUnit).filterNot(discardAfterTyper) ctx.run.nn.checkSuspendedUnits(newUnits)