Skip to content

Commit a4c553a

Browse files
committed
Fixed 3.7.1 breakage in compiled code. Next are scripts...
Signed-off-by: Dean Wampler <[email protected]>
1 parent 0bd8014 commit a4c553a

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

src/main/scala/progscala3/appdesign/parthenon/PayrollUseCases.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object PayrollUseCases:
3232
val files =
3333
if inputFileNames.length == 0 then Seq("misc/parthenon-payroll.txt")
3434
else inputFileNames
35-
for (file <- files) do
35+
for file <- files do
3636
println(s"Processing input file: $file")
3737
val data = fromFile(file)
3838
biweeklyPayrollPerEmployee(data)

src/main/scala/progscala3/basicoop/tagging/Tags.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ end Tagging
5757
// Compilation Errors!
5858
// om.compare(x, y)
5959
val expected: Double @@ Meter = 1.0.tag
60-
assert(xs.min(om) == expected)
60+
// 2025-06-16: In Scala 3.7, "using" is required in the next line:
61+
assert(xs.min(using om) == expected)
6162
// Compilation Error!
6263
// xs.min(o)
6364
end TryTagging

src/main/scala/progscala3/basicoop/tagging/Tags2.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ end Tagging2
6060
// Compilation Errors!
6161
// om.compare(x, y)
6262
// x == y
63-
assert(xs.min(om) == 1.0.tag[Meter])
63+
// 2025-06-16: In Scala 3.7, "using" is required in the next line:
64+
assert(xs.min(using om) == 1.0.tag[Meter])
6465
// Compilation Error!
6566
// xs.min(o)
6667
end TryTagging2

src/main/scala/progscala3/concurrency/futures/FutureForComp.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def make(i: Int): Future[String] =
1818
else Future.failed(ThatsOdd(i))
1919

2020
@main def TryFuturesForComp =
21-
val futures = for {
21+
val futures = for
2222
i <- (0 to 9)
2323
future = make(i)
24-
} yield future
24+
yield future
2525
futures.map(_.onComplete(doComplete))

src/test/scala/progscala3/contexts/UsingParameterSuite.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ class UsingParameterSuite extends FunSuite:
88

99
case class MySeq[A](seq: Seq[A]):
1010
def sortBy1[B](f: A => B)(implicit ord: Ordering[B]): Seq[A] =
11-
seq.sortBy(f)(ord)
11+
// 2025-06-16: In Scala 3.7, "using" is required in the next line:
12+
seq.sortBy(f)(using ord)
1213

1314
def sortBy2[B : Ordering](f: A => B): Seq[A] =
14-
seq.sortBy(f)(summon[Ordering[B]])
15+
// 2025-06-16: In Scala 3.7, "using" is required in the next line:
16+
seq.sortBy(f)(using summon[Ordering[B]])
1517

1618
test("A view type can be accessed by implicitly") {
1719
val seq = MySeq(Seq(1,3,5,2,4))

0 commit comments

Comments
 (0)