Skip to content

Commit dda444e

Browse files
committed
test with scala 3.7-RC1
1 parent 3e7c62f commit dda444e

File tree

21 files changed

+40
-40
lines changed

21 files changed

+40
-40
lines changed

Modules/Aead/js/src/test/scala/com/github/ckuessner/aead/AeadHelperTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AeadHelperTest extends munit.FunSuite {
3535
)
3636

3737
test("initialization should not fail") {
38-
AeadHelper.ready().map(_ => ())(executionContext)
38+
AeadHelper.ready().map(_ => ())(using executionContext)
3939
}
4040

4141
test("generateKey should not fail") {

Modules/Aead/shared/src/test/scala/com/github/ckuessner/aead/AeadKeyTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class AeadKeyTest extends munit.FunSuite {
1010
given executionContext: ExecutionContext = TestExecutionContext.executionContext
1111

1212
test("AeadHelper.ready should work") {
13-
AeadHelper.ready().map(_ => ())(executionContext)
13+
AeadHelper.ready().map(_ => ())(using executionContext)
1414
}
1515

1616
test("fromRawKey should work with base64 encoded keys generated by Tink") {

Modules/Aead/shared/src/test/scala/com/github/ckuessner/aead/AeadTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AeadTest extends munit.ScalaCheckSuite {
1414
given executionContext: ExecutionContext = TestExecutionContext.executionContext
1515

1616
test("AeadHelper.ready should work") {
17-
AeadHelper.ready().map(_ => ())(executionContext)
17+
AeadHelper.ready().map(_ => ())(using executionContext)
1818
}
1919

2020
test("decrypt should successfully decrypt generated byte array and empty associated data") {

Modules/DTN/shared/src/main/scala/dtn/routing/RdtMemory.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object BundleIdAgeOrdering extends Ordering[String] {
1717
object GarbageCollector {
1818
val SOFT_MAX_BUNDLE_COUNT = 20
1919

20-
var sortedIds: SortedSet[String] = TreeSet[String]()(BundleIdAgeOrdering)
20+
var sortedIds: SortedSet[String] = TreeSet[String]()(using BundleIdAgeOrdering)
2121

2222
def shouldKeep(bundleId: String): Boolean = {
2323
sortedIds = sortedIds + bundleId

Modules/Deltalens/src/test/scala/com/softwaremill/quicklens/SecondParamListTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SecondParamListTest extends AnyFlatSpec with Matchers {
1212

1313
val d: Double = 1.0
1414

15-
val state1 = State(true)(d)
15+
val state1 = State(true)(using d)
1616

1717
given dd: Double = d
1818
val state2 = state1.modify(_.inside).setTo(true)

Modules/Examples/Misc JVM/src/main/scala/ex2021encfixtodo/SyncedTodoListCrdt.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class SyncedTodoListCrdt(val replicaId: LocalUid) {
5757
private def runInCrdtExecContext[Ret](op: () => Ret): Ret = Await.result[Ret](
5858
Future {
5959
op()
60-
}(crdtExecContext),
60+
}(using crdtExecContext),
6161
100.milliseconds
6262
)
6363

Modules/Examples/Misc JVM/src/main/scala/ex2021encfixtodo/TodoListApp.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TodoListApp extends JFXApp3 {
2424

2525
val addTodoButton = new Button {
2626
text = "+"
27-
onAction = () => {
27+
onAction() = () => {
2828
TodoListController.addTodo(TodoEntry(newTodoTextField.text.value))
2929
newTodoTextField.clear()
3030
}
@@ -48,7 +48,7 @@ class TodoListApp extends JFXApp3 {
4848
)
4949

5050
val addConnectionButton = new Button("Connect")
51-
addConnectionButton.onAction = () => {
51+
addConnectionButton.onAction() = () => {
5252
val connectionString = connectionTextField.getText
5353
if !connectionString.forall(Character.isWhitespace) then
5454
TodoListController.connect(connectionString)

Modules/Examples/Misc JVM/src/main/scala/ex2024travel/lofi_acl/example/monotonic_acl/InvitationDialogScene.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InvitationDialogScene(invitation: Invitation, travelPlanModel: TravelPlanM
3030
inviteText.editable = false
3131

3232
private val createInviteButton = Button("Create Invite")
33-
createInviteButton.onAction = _ => {
33+
createInviteButton.onAction() = _ => {
3434
val clipboard = Clipboard.systemClipboard
3535
val content = new ClipboardContent()
3636
content.putString(inviteText.getText)
@@ -55,7 +55,7 @@ class InvitationDialogScene(invitation: Invitation, travelPlanModel: TravelPlanM
5555
}
5656

5757
private val delegatePermissionsButton = Button("Delegate permissions")
58-
delegatePermissionsButton.onAction = _ => {
58+
delegatePermissionsButton.onAction() = _ => {
5959
val permissionReceiverComboBox = {
6060
val otherReplicas = travelPlanModel.currentAcl.read.keySet.filterNot(_ == travelPlanModel.publicId).toSeq
6161
val comboBox = ComboBox(otherReplicas)
@@ -69,7 +69,7 @@ class InvitationDialogScene(invitation: Invitation, travelPlanModel: TravelPlanM
6969
confirmationButton.disable <== permissionReceiverComboBox.selectionModel.value.selectedItemProperty().isNull
7070
rootPane.bottom = HBox(permissionReceiverComboBox, confirmationButton)
7171

72-
confirmationButton.onAction = _ => {
72+
confirmationButton.onAction() = _ => {
7373
val receivingReplica = permissionReceiverComboBox.getValue
7474
Platform.runLater { () =>
7575
try {

Modules/Examples/Misc JVM/src/main/scala/ex2024travel/lofi_acl/example/monotonic_acl/MainScene.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class MainScene extends Scene {
1919

2020
private val createNewDocumentButton: Button = new Button("Create new Travel Plan Document")
2121
createNewDocumentButton.alignment = Pos.Center
22-
createNewDocumentButton.onAction = _ => createNewDocumentButtonPressed()
22+
createNewDocumentButton.onAction() = _ => createNewDocumentButtonPressed()
2323
createNewDocumentButton.disable <== documentIsOpen
2424

2525
private val invitationTextField = new TextField {
@@ -29,7 +29,7 @@ class MainScene extends Scene {
2929

3030
private val joinDocumentButton: Button = new Button("Join")
3131
joinDocumentButton.alignment = Pos.Center
32-
joinDocumentButton.onAction = _ => joinDocumentButtonPressed()
32+
joinDocumentButton.onAction() = _ => joinDocumentButtonPressed()
3333
joinDocumentButton.disable <== documentIsOpen || invitationTextField.text.isEmpty
3434

3535
rootPane.center = VBox(

Modules/Examples/Misc JVM/src/main/scala/ex2024travel/lofi_acl/example/monotonic_acl/TravelPlanView.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class TravelPlanView(viewModel: TravelPlanViewModel) extends GridPane {
1111

1212
private val shareButton = Button()
1313
shareButton.text = "Share"
14-
shareButton.onAction = ev => viewModel.createInviteButtonPressed()
14+
shareButton.onAction() = ev => viewModel.createInviteButtonPressed()
1515

1616
private val bucketListView: ListView[String] = ListView[String]()
1717
bucketListView.cellFactory = viewModel.bucketListCellFactory
@@ -22,7 +22,7 @@ class TravelPlanView(viewModel: TravelPlanViewModel) extends GridPane {
2222
addBucketListEntryTextField.promptText = "Bucket List Entry"
2323
private val addBucketListEntryButton = Button("Add Entry")
2424
addBucketListEntryButton.disable <== addBucketListEntryTextField.text.isEmpty
25-
addBucketListEntryButton.onAction = { ev =>
25+
addBucketListEntryButton.onAction() = { ev =>
2626
val entryText = addBucketListEntryTextField.text.get()
2727
addBucketListEntryTextField.text.value = ""
2828
viewModel.createBucketListEntryButtonPressed(entryText)
@@ -41,7 +41,7 @@ class TravelPlanView(viewModel: TravelPlanViewModel) extends GridPane {
4141
addExpenseAmountTextField.prefWidth = 70
4242
private val addExpenseEntryButton = Button("Add Expense")
4343
addExpenseEntryButton.disable <== addExpenseEntryTextField.text.isEmpty
44-
addExpenseEntryButton.onAction = { ev =>
44+
addExpenseEntryButton.onAction() = { ev =>
4545
val description = addExpenseEntryTextField.text.get()
4646
addExpenseEntryTextField.text.value = ""
4747
val amount = addExpenseAmountTextField.text.get()

Modules/Microbenchmarks/src/main/scala/benchmarks/philosophers/PaperPhilosophers.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ object PaperPhilosophers {
276276

277277
val executor = Executors.newFixedThreadPool(threadCount)
278278
val execContext = scala.concurrent.ExecutionContext.fromExecutor(executor)
279-
val threads = for i <- 0 until threadCount yield Future { driver(i) }(execContext)
279+
val threads = for i <- 0 until threadCount yield Future { driver(i) }(using execContext)
280280

281281
while threads.exists(!_.isCompleted) && !abort && continue() do { Thread.sleep(10) }
282282
val timeout = System.currentTimeMillis() + 3000

Modules/RDTs/src/main/scala/rdts/datatypes/experiments/AutomergyOpGraphLWW.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object AutomergyOpGraphLWW {
2424

2525
def values: List[T] =
2626
def getTerminals(cur: Map[Id, Entry[T]]): List[T] =
27-
cur.toList.sortBy(_._1)(CausalTime.ordering.reverse).map(_._2.op).flatMap:
27+
cur.toList.sortBy(_._1)(using CausalTime.ordering.reverse).map(_._2.op).flatMap:
2828
case Op.set(v) => List(v)
2929
case Op.del => Nil
3030
case Op.undo(anchor) => elements.get(anchor).toList.flatMap: pred =>

Modules/RDTs/src/test/scala/test/rdts/baseproperties/DecomposePropertyChecks.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ abstract class DecomposePropertyChecks[A](
5959
t.withBodyMap(_.transformCompat {
6060
case Failure(exception) => Success(new TestValues.FlakyFailure(exception))
6161
case succ => succ
62-
}(munitExecutionContext))
62+
}(using munitExecutionContext))
6363
}
6464
)
6565
)

Modules/RDTs/src/test/scala/test/rdts/baseproperties/LatticePropertyChecks.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ abstract class LatticePropertyChecks[A](
7777
t.withBodyMap(_.transformCompat {
7878
case Failure(exception) => Success(new TestValues.FlakyFailure(exception))
7979
case succ => succ
80-
}(munitExecutionContext))
80+
}(using munitExecutionContext))
8181
}
8282
)
8383
)

Modules/Reactives/jvm/src/main/scala/reactives/fullmv/FullMVUtil.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ object FullMVUtil {
5858
}
5959
def condenseCallResults(accumulator: Iterable[Future[Unit]]): Future[Unit] = {
6060
// TODO this should collect exceptions..
61-
accumulator.foldLeft(Future.successful(())) { (fu, call) => fu.flatMap(_ => call)(notWorthToMoveToTaskpool) }
61+
accumulator.foldLeft(Future.successful(())) { (fu, call) => fu.flatMap(_ => call)(using notWorthToMoveToTaskpool) }
6262
}
6363
}

Modules/Reactives/jvm/src/main/scala/reactives/fullmv/TurnImplBundle.scala

+6-6
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class FullMVTurnImpl(
344344

345345
FullMVUtil.broadcast(successorsIncludingSelf)(_.maybeNewReachableSubtree(this, predecessorSpanningTree)).map(_ =>
346346
predecessor.phase == TurnPhase.Completed
347-
)(FullMVUtil.notWorthToMoveToTaskpool)
347+
)(using FullMVUtil.notWorthToMoveToTaskpool)
348348
}
349349
}
350350

@@ -450,7 +450,7 @@ class FullMVTurnImpl(
450450
case x @ LockedState(lock) => Future.successful(x)
451451
case UnlockedState => UnlockedState.futured
452452
case ConcurrentDeallocation => getLockedRoot
453-
}(FullMVUtil.notWorthToMoveToTaskpool)
453+
}(using FullMVUtil.notWorthToMoveToTaskpool)
454454
}
455455
}
456456
override def tryLock(): Future[TryLockResult] = {
@@ -484,7 +484,7 @@ class FullMVTurnImpl(
484484
case GarbageCollected0 =>
485485
assert(subsumableLock.get() != l, s"$l tryLock returned GC'd although it is still referenced")
486486
tryLock0(hopCount)
487-
}(FullMVUtil.notWorthToMoveToTaskpool)
487+
}(using FullMVUtil.notWorthToMoveToTaskpool)
488488
}
489489
}
490490

@@ -519,7 +519,7 @@ class FullMVTurnImpl(
519519
case GarbageCollected0 =>
520520
assert(subsumableLock.get() != l, s"$l trySubsume returned GC'd although it is still referenced")
521521
trySubsume0(hopCount, lockedNewParent)
522-
}(FullMVUtil.notWorthToMoveToTaskpool)
522+
}(using FullMVUtil.notWorthToMoveToTaskpool)
523523
}
524524
}
525525

@@ -532,7 +532,7 @@ class FullMVTurnImpl(
532532
s"[${Thread.currentThread().getName}] $this returning tryLock result $res to remote (retaining thread reference as remote transfer reference)"
533533
)
534534
res
535-
}(FullMVUtil.notWorthToMoveToTaskpool)
535+
}(using FullMVUtil.notWorthToMoveToTaskpool)
536536
}
537537
override def remoteTrySubsume(lockedNewParent: SubsumableLock): Future[TrySubsumeResult] = {
538538
if SubsumableLockImpl.DEBUG then
@@ -544,7 +544,7 @@ class FullMVTurnImpl(
544544
)
545545
lockedNewParent.localSubRefs(1)
546546
res
547-
}(FullMVUtil.notWorthToMoveToTaskpool)
547+
}(using FullMVUtil.notWorthToMoveToTaskpool)
548548
}
549549

550550
private def trySwap(from: SubsumableLock, to: SubsumableLock): Int = {

Modules/Reactives/jvm/src/main/scala/reactives/fullmv/mirrors/SubsumableLockReflection.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SubsumableLockReflection(
4949
case RemoteGCd =>
5050
assert(this.refCount.get <= 0, s"remote was gc'd while $this still holds a reference")
5151
GarbageCollected0
52-
}(FullMVUtil.notWorthToMoveToTaskpool)
52+
}(using FullMVUtil.notWorthToMoveToTaskpool)
5353
}
5454

5555
override def trySubsume0(hopCount: Int, lockedNewParent: SubsumableLock): Future[TrySubsumeResult0] = {
@@ -97,7 +97,7 @@ class SubsumableLockReflection(
9797
case RemoteGCd =>
9898
assert(this.refCount.get <= 0, s"remote was gc'd while $this still holds a reference")
9999
GarbageCollected0
100-
}(FullMVUtil.notWorthToMoveToTaskpool)
100+
}(using FullMVUtil.notWorthToMoveToTaskpool)
101101
}
102102
}
103103

@@ -115,7 +115,7 @@ class SubsumableLockReflection(
115115
if Host.DEBUG then
116116
println(s"[${Thread.currentThread().getName}] $this passing through tryLock result $res")
117117
res
118-
}(FullMVUtil.notWorthToMoveToTaskpool)
118+
}(using FullMVUtil.notWorthToMoveToTaskpool)
119119
}
120120
override def remoteTrySubsume(lockedNewParent: SubsumableLock): Future[RemoteTrySubsumeResult] = {
121121
if Host.DEBUG then
@@ -126,7 +126,7 @@ class SubsumableLockReflection(
126126
if Host.DEBUG then
127127
println(s"[${Thread.currentThread().getName}] $this passing through trySubsume $lockedNewParent result $res")
128128
res
129-
}(FullMVUtil.notWorthToMoveToTaskpool)
129+
}(using FullMVUtil.notWorthToMoveToTaskpool)
130130
}
131131

132132
override protected def dumped(): Unit = {

Modules/Reactives/jvm/src/main/scala/reactives/fullmv/sgt/synchronization/SubsumableLockBundle.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class SubsumableLockImpl(override val host: SubsumableLockHost, override val gui
167167
s"[${Thread.currentThread().getName}] retrying tryLock $this after parent was concurrently deallocated"
168168
)
169169
tryLock0NoTail(hopCount)
170-
}(FullMVUtil.notWorthToMoveToTaskpool)
170+
}(using FullMVUtil.notWorthToMoveToTaskpool)
171171
}
172172
}
173173

@@ -248,7 +248,7 @@ class SubsumableLockImpl(override val host: SubsumableLockHost, override val gui
248248
s"[${Thread.currentThread().getName}] retrying trySubsume $this after parent was concurrently deallocated"
249249
)
250250
trySubsume0NoTail(hopCount, lockedNewParent)
251-
}(FullMVUtil.notWorthToMoveToTaskpool)
251+
}(using FullMVUtil.notWorthToMoveToTaskpool)
252252
}
253253
}
254254
}
@@ -365,7 +365,7 @@ class SubsumableLockImpl(override val host: SubsumableLockHost, override val gui
365365
s"[${Thread.currentThread().getName}] retrying remote tryLock $this after parent was concurrently deallocated"
366366
)
367367
remoteTryLockNoTail()
368-
}(FullMVUtil.notWorthToMoveToTaskpool)
368+
}(using FullMVUtil.notWorthToMoveToTaskpool)
369369
}
370370
}
371371

@@ -442,7 +442,7 @@ class SubsumableLockImpl(override val host: SubsumableLockHost, override val gui
442442
s"[${Thread.currentThread().getName}] retrying remote trySubsume $this after parent was concurrently deallocated"
443443
)
444444
this.remoteTrySubsumeNoTail(lockedNewParent)
445-
}(FullMVUtil.notWorthToMoveToTaskpool)
445+
}(using FullMVUtil.notWorthToMoveToTaskpool)
446446
}
447447
}
448448

Modules/Replication/js/src/main/scala/replication/WebRTCBroadcastHandlingView.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class WebRTCHandling(readyChannel: Option[Callback[SessionDescription]]) {
167167
placeholder := "remote session description",
168168
oninput := { (ev: UIEvent) =>
169169
try
170-
val cs = readFromString(ev.target.asInstanceOf[dom.html.TextArea].value)(codec)
170+
val cs = readFromString(ev.target.asInstanceOf[dom.html.TextArea].value)(using codec)
171171
println(s"pending resolved, setting connector")
172172
peer.updateRemoteDescription(cs).run(using ())(errorReporter)
173173
catch
@@ -190,7 +190,7 @@ class WebRTCHandling(readyChannel: Option[Callback[SessionDescription]]) {
190190
onfocus := { (ev: UIEvent) =>
191191
ev.target.asInstanceOf[dom.html.TextArea].select()
192192
},
193-
writeToString(sessionDescription)(codec)
193+
writeToString(sessionDescription)(using codec)
194194
).render
195195
}
196196

Modules/Replication/jvm/src/main/scala/replication/dtn/dtn.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def run(): Unit =
154154
given LocalUid = replica.id.convert
155155

156156
val bundleString = sget(URI.create(s"$api/status/bundles")).bind
157-
val bundles = traverse(readFromString[List[String]](bundleString)(JsonCodecMaker.make).map { id =>
157+
val bundles = traverse(readFromString[List[String]](bundleString)(using JsonCodecMaker.make).map { id =>
158158
bget(URI.create(s"$api/download?$id"))
159159
}).bind
160160

project/Settings.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import sbt.Keys.*
88
object Settings {
99

1010
// also consider updating the -source param below
11-
val scala3VersionString = sys.env.getOrElse("SCALA_VERSION", "3.6.4")
11+
val scala3VersionString = sys.env.getOrElse("SCALA_VERSION", "3.7.0-RC1")
1212

1313
// needs either 3.7 or 3.5 minor version in 3.6, otherwise there is a unfixable warning about changed implicit order
1414
// see https://github.com/scala/scala3/issues/22153
@@ -34,7 +34,7 @@ object Settings {
3434
// enabled to see what breaks and maybe play around with
3535
// named tuples seems likely for 3.7, modularity is not SIP approved (though I also have not seen someone arguing against)
3636
def experimentalOptions =
37-
scalacOptions ++= List("-language:experimental.namedTuples", "-language:experimental.modularity")
37+
scalacOptions ++= List("-language:experimental.modularity")
3838

3939
// Spell out feature and deprecation warnings instead of summarizing them into a single warning
4040
// always turn this on to make the compiler less ominous

0 commit comments

Comments
 (0)