Skip to content

Commit 2030c51

Browse files
committed
Convert TreeUnpickler context functions to CFTs (2)
1 parent 57d7dde commit 2030c51

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ class TreeUnpickler(reader: TastyReader,
705705
case IMPORT =>
706706
skipTree()
707707
case PACKAGE =>
708-
processPackage { (pid, end) => implicit ctx => indexStats(end) }
708+
processPackage { (pid, end) => indexStats(end) }
709709
case _ =>
710710
skipTree()
711711
initsFlags = EmptyFlags
@@ -719,13 +719,13 @@ class TreeUnpickler(reader: TastyReader,
719719
* - an end address,
720720
* - a context which has the processed package as owner
721721
*/
722-
def processPackage[T](op: (RefTree, Addr) => Context => T)(using Context): T = {
722+
def processPackage[T](op: (RefTree, Addr) => Context ?=> T)(using Context): T = {
723723
val sctx = sourceChangeContext()
724724
if (sctx `ne` ctx) return processPackage(op)(using sctx)
725725
readByte()
726726
val end = readEnd()
727727
val pid = ref(readTermRef()).asInstanceOf[RefTree]
728-
op(pid, end)(localContext(pid.symbol.moduleClass))
728+
op(pid, end)(using localContext(pid.symbol.moduleClass))
729729
}
730730

731731
/** Create symbols the longest consecutive sequence of parameters with given
@@ -963,8 +963,7 @@ class TreeUnpickler(reader: TastyReader,
963963
readImport()
964964
case PACKAGE =>
965965
val start = currentAddr
966-
processPackage { (pid, end) => ctx =>
967-
given Context = ctx
966+
processPackage { (pid, end) =>
968967
setSpan(start, PackageDef(pid, readIndexedStats(exprOwner, end)))
969968
}
970969
case _ =>

0 commit comments

Comments
 (0)