Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport Scala 3 changes #4347

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading