Skip to content

Commit 550c316

Browse files
committed
use explicit unitContext
1 parent e92a834 commit 550c316

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

compiler/src/dotty/tools/dotc/fromtasty/ReadTasty.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ReadTasty extends Phase {
2424
withMode(Mode.ReadPositions) {
2525
val nextUnits = collection.mutable.ListBuffer.empty[CompilationUnit]
2626
val unitContexts = units.view.map(ctx.fresh.setCompilationUnit)
27-
for given Context <- unitContexts if addTasty(nextUnits += _) do ()
27+
for unitContext <- unitContexts if addTasty(nextUnits += _)(using unitContext) do ()
2828
nextUnits.toList
2929
}
3030

compiler/src/dotty/tools/dotc/parsing/ParserPhase.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class Parser extends Phase {
4848

4949
val unitContexts0 =
5050
for
51-
given Context <- unitContexts
52-
if parse
53-
yield ctx
51+
unitContext <- unitContexts
52+
if parse(using unitContext)
53+
yield unitContext
5454

5555
record("parsedTrees", ast.Trees.ntrees)
5656

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Checker extends Phase:
4141
val unitContexts = units.map(unit => checkCtx.fresh.setCompilationUnit(unit))
4242

4343
val units0 =
44-
for given Context <- unitContexts if traverse(traverser) yield ctx.compilationUnit
44+
for unitContext <- unitContexts if traverse(traverser)(using unitContext) yield unitContext.compilationUnit
4545

4646
cancellable {
4747
val classes = traverser.getClasses()

compiler/src/dotty/tools/dotc/typer/TyperPhase.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase {
7575
val unitContexts0 =
7676
try
7777
for
78-
given Context <- unitContexts
79-
if enterSyms
80-
yield ctx
78+
unitContext <- unitContexts
79+
if enterSyms(using unitContext)
80+
yield unitContext
8181
finally
8282
ctx.run.advanceSubPhase() // tick from "typer (indexing)" to "typer (typechecking)"
8383

@@ -94,19 +94,19 @@ class TyperPhase(addRootImports: Boolean = true) extends Phase {
9494
val unitContexts1 =
9595
try
9696
for
97-
given Context <- unitContexts0
98-
if typeCheck
99-
yield ctx
97+
unitContext <- unitContexts0
98+
if typeCheck(using unitContext)
99+
yield unitContext
100100
finally
101101
ctx.run.advanceSubPhase() // tick from "typer (typechecking)" to "typer (java checking)"
102102

103103
record("total trees after typer", ast.Trees.ntrees)
104104

105105
val unitContexts2 =
106106
for
107-
given Context <- unitContexts1
108-
if javaCheck // after typechecking to avoid cycles
109-
yield ctx
107+
unitContext <- unitContexts1
108+
if javaCheck(using unitContext) // after typechecking to avoid cycles
109+
yield unitContext
110110

111111
val newUnits = unitContexts2.map(_.compilationUnit).filterNot(discardAfterTyper)
112112
ctx.run.nn.checkSuspendedUnits(newUnits)

0 commit comments

Comments
 (0)