Skip to content

Commit

Permalink
chore: Fix ActorDocSpec on Scala 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Pin committed Jan 30, 2024
1 parent 8a759ba commit daf84d7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/src/test/scala/docs/actor/ActorDocSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ class ActorDocSpec extends PekkoSpec("""
// #system-actorOf
shutdown(system)
}
private abstract class DummyActorProxy {
def actorRef: ActorRef
}

"creating actor with IndirectActorProducer" in {
class Echo(name: String) extends Actor {
Expand All @@ -454,7 +457,8 @@ class ActorDocSpec extends PekkoSpec("""
}
}

val a: { def actorRef: ActorRef } = new AnyRef {
import scala.language.existentials
val a: DummyActorProxy = new DummyActorProxy() {
val applicationContext = this

// #creating-indirectly
Expand All @@ -474,10 +478,8 @@ class ActorDocSpec extends PekkoSpec("""
val actorRef = system.actorOf(Props(classOf[DependencyInjector], applicationContext, "hello"), "helloBean")
// #creating-indirectly
}
val actorRef = {
import scala.language.reflectiveCalls
a.actorRef
}

val actorRef = a.actorRef

val message = 42
implicit val self = testActor
Expand Down

0 comments on commit daf84d7

Please sign in to comment.