Skip to content

Commit

Permalink
Backport Scala 3 changes (com-lihaoyi#4347)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi authored Jan 17, 2025
1 parent 863f1af commit f4270e7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ object CodeSigHelloTests extends UtestIntegrationTestSuite {
modifyFile(workspacePath / "build.mill", _.replace("running foo", "running foo2"))
val mangledFoo = eval("foo")

assert(mangledFoo.out.linesIterator.toSeq == Seq("running foo2", "running helperFoo"))
val out1 = mangledFoo.out.linesIterator.toSeq
assert(out1 == Seq("running foo2", "running helperFoo"))

val cached2 = eval("foo")
assert(cached2.out == "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ trait ReactScriptsModule extends TypeScriptModule {
}

override def forkEnv =
Task.Anon {
Task {
Map("NODE_PATH" -> Seq(
".",
compile()._1.path,
Expand Down
2 changes: 1 addition & 1 deletion main/src/mill/main/SelectiveExecutionModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ trait SelectiveExecutionModule extends mill.define.Module {
} match {
case Left(err) => Result.Failure(err)
case Right((watched, Left(err))) => Result.Failure(err)
case Right((watched, Right(res))) => Result.Success(res)
case Right((watched, Right(res))) => Result.Success(())
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion main/src/mill/main/TokenReaders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ trait TokenReaders0 {
case t: TokensReader.Leftover[_, _] => new LeftoverTaskTokenReader[T](t)
}

def given = () // dummy for scala 2/3 compat
def `given` = () // dummy for scala 2/3 compat
}
8 changes: 5 additions & 3 deletions main/util/src/mill/util/SpanningForest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ private[mill] object SpanningForest {

while (queued.nonEmpty) {
val current = queued.dequeue()
seen.add(current)
seenList.append(current)

for (next <- edges(current).iterator) {
if (!seen.contains(next)) queued.enqueue(next)
for (next <- edges(current)) {
if (!seen.contains(next)) {
seen.add(next)
queued.enqueue(next)
}
}
}
seenList.toSeq
Expand Down
4 changes: 2 additions & 2 deletions main/util/test/src/mill/util/SpanningForestTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ object SpanningForestTests extends TestSuite {
Array(1),
Array(2),
Array(3),
Array(),
Array()
Array[Int](),
Array[Int]()
),
Set(0),
limitToImportantVertices = false
Expand Down

0 comments on commit f4270e7

Please sign in to comment.