Skip to content

Commit fc1aaf8

Browse files
committed
fix obvious dotty compile errors
1 parent b9fdd06 commit fc1aaf8

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

akka-testkit/src/main/scala/akka/testkit/TestKit.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ object TestProbe {
10331033
}
10341034

10351035
trait ImplicitSender { this: TestKitBase =>
1036-
implicit def self = testActor
1036+
implicit def self: ActorRef = testActor
10371037
}
10381038

10391039
trait DefaultTimeout { this: TestKitBase =>

akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object AkkaSpec {
4545

4646
def mapToConfig(map: Map[String, Any]): Config = {
4747
import akka.util.ccompat.JavaConverters._
48-
ConfigFactory.parseMap(map.asJava)
48+
ConfigFactory.parseMap(map.asInstanceOf[Map[String, AnyRef]].asJava)
4949
}
5050

5151
def testNameFromCallStack(classToStartFrom: Class[_]): String = {
@@ -100,7 +100,7 @@ abstract class AkkaSpec(_system: ActorSystem)
100100
with TypeCheckedTripleEquals
101101
with ScalaFutures {
102102

103-
implicit val patience = PatienceConfig(testKitSettings.DefaultTimeout.duration, Span(100, Millis))
103+
implicit val patience: PatienceConfig = PatienceConfig(testKitSettings.DefaultTimeout.duration, Span(100, Millis))
104104

105105
def this(config: Config) =
106106
this(
@@ -118,12 +118,12 @@ abstract class AkkaSpec(_system: ActorSystem)
118118

119119
override val invokeBeforeAllAndAfterAllEvenIfNoTestsAreExpected = true
120120

121-
final override def beforeAll: Unit = {
121+
final override def beforeAll(): Unit = {
122122
startCoroner()
123123
atStartup()
124124
}
125125

126-
final override def afterAll: Unit = {
126+
final override def afterAll(): Unit = {
127127
beforeTermination()
128128
shutdown()
129129
afterTermination()

akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import org.scalatest.wordspec.AnyWordSpec
1111

1212
class DefaultTimeoutSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with TestKitBase with DefaultTimeout {
1313

14-
implicit lazy val system = ActorSystem("AkkaCustomSpec")
14+
implicit val system: ActorSystem = ActorSystem("AkkaCustomSpec")
1515

16-
override def afterAll = system.terminate
16+
override def afterAll() = system.terminate()
1717

1818
"A spec with DefaultTimeout" should {
1919
"use timeout from settings" in {

akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import org.scalatest.wordspec.AnyWordSpec
1111

1212
class ImplicitSenderSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll with TestKitBase with ImplicitSender {
1313

14-
implicit lazy val system = ActorSystem("AkkaCustomSpec")
14+
implicit val system: ActorSystem = ActorSystem("AkkaCustomSpec")
1515

16-
override def afterAll = system.terminate
16+
override def afterAll() = system.terminate()
1717

1818
"An ImplicitSender" should {
1919
"have testActor as its self" in {

akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ object TestActorRefSpec {
4242
def receiveT = {
4343
case "complexRequest" => {
4444
replyTo = sender()
45-
val worker = TestActorRef(Props[WorkerActor])
45+
val worker = TestActorRef(Props[WorkerActor]())
4646
worker ! "work"
4747
}
4848
case "complexRequest2" =>
49-
val worker = TestActorRef(Props[WorkerActor])
49+
val worker = TestActorRef(Props[WorkerActor]())
5050
worker ! sender()
5151
case "workDone" => replyTo ! "complexReply"
5252
case "simpleRequest" => sender() ! "simpleReply"
@@ -143,7 +143,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA
143143
}
144144

145145
"support reply via sender()" in {
146-
val serverRef = TestActorRef(Props[ReplyActor])
146+
val serverRef = TestActorRef(Props[ReplyActor]())
147147
val clientRef = TestActorRef(Props(classOf[SenderActor], serverRef))
148148

149149
counter = 4
@@ -169,7 +169,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA
169169

170170
"stop when sent a poison pill" in {
171171
EventFilter[ActorKilledException]().intercept {
172-
val a = TestActorRef(Props[WorkerActor])
172+
val a = TestActorRef(Props[WorkerActor]())
173173
system.actorOf(Props(new Actor {
174174
context.watch(a)
175175
def receive = {
@@ -251,7 +251,7 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA
251251
}
252252

253253
"allow override of dispatcher" in {
254-
val a = TestActorRef(Props[WorkerActor].withDispatcher("disp1"))
254+
val a = TestActorRef(Props[WorkerActor]().withDispatcher("disp1"))
255255
a.underlying.dispatcher.getClass should ===(classOf[Dispatcher])
256256
}
257257

@@ -323,24 +323,24 @@ class TestActorRefSpec extends AkkaSpec("disp1.type=Dispatcher") with BeforeAndA
323323
}
324324

325325
"allow creation of a TestActorRef with a default supervisor with Props" in {
326-
val ref = TestActorRef[WorkerActor](Props[WorkerActor])
326+
val ref = TestActorRef[WorkerActor](Props[WorkerActor]())
327327
ref.underlyingActor.supervisor should be(system.asInstanceOf[ActorSystemImpl].guardian)
328328
}
329329

330330
"allow creation of a TestActorRef with a default supervisor and specified name with Props" in {
331-
val ref = TestActorRef[WorkerActor](Props[WorkerActor], "specificPropsActor")
331+
val ref = TestActorRef[WorkerActor](Props[WorkerActor](), "specificPropsActor")
332332
ref.underlyingActor.name should be("specificPropsActor")
333333
}
334334

335335
"allow creation of a TestActorRef with a specified supervisor with Props" in {
336336
val parent = TestActorRef[ReplyActor]
337-
val ref = TestActorRef[WorkerActor](Props[WorkerActor], parent)
337+
val ref = TestActorRef[WorkerActor](Props[WorkerActor](), parent)
338338
ref.underlyingActor.supervisor should be(parent)
339339
}
340340

341341
"allow creation of a TestActorRef with a specified supervisor and specified name with Props" in {
342342
val parent = TestActorRef[ReplyActor]
343-
val ref = TestActorRef[WorkerActor](Props[WorkerActor], parent, "specificSupervisedPropsActor")
343+
val ref = TestActorRef[WorkerActor](Props[WorkerActor](), parent, "specificSupervisedPropsActor")
344344
ref.underlyingActor.name should be("specificSupervisedPropsActor")
345345
ref.underlyingActor.supervisor should be(parent)
346346
}

akka-testkit/src/test/scala/akka/testkit/TestActorsSpec.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
package akka.testkit
66

7+
import akka.actor.actorRef2Scala
8+
79
class TestActorsSpec extends AkkaSpec with ImplicitSender {
810

911
import TestActors.{ echoActorProps, forwardActorProps }

akka-testkit/src/test/scala/akka/testkit/TestFSMRefSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TestFSMRefSpec extends AkkaSpec {
4545
val fsm = TestFSMRef(new Actor with FSM[Int, Null] {
4646
startWith(1, null)
4747
when(1) {
48-
case _ => stay
48+
case _ => stay()
4949
}
5050
}, "test-fsm-ref-2")
5151
fsm.isTimerActive("test") should ===(false)
@@ -65,7 +65,7 @@ class TestFSMRefSpec extends AkkaSpec {
6565
class TestFSMActor extends Actor with FSM[Int, Null] {
6666
startWith(1, null)
6767
when(1) {
68-
case _ => stay
68+
case _ => stay()
6969
}
7070
val supervisor = context.parent
7171
val name = context.self.path.name

0 commit comments

Comments
 (0)