diff --git a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/fromclassic/TypedSample.scala b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/fromclassic/TypedSample.scala index 961da8d24c..7c28de2425 100644 --- a/akka-actor-typed-tests/src/test/scala/docs/akka/typed/fromclassic/TypedSample.scala +++ b/akka-actor-typed-tests/src/test/scala/docs/akka/typed/fromclassic/TypedSample.scala @@ -49,10 +49,10 @@ object TypedSample { children.get(name) match { case Some(ref) => ref ! childCommand - context.watchWith(ref, ChildTerminated(name)) Behaviors.same case None => val ref = context.spawn(Child(), name) + context.watchWith(ref, ChildTerminated(name)) ref ! childCommand updated(children + (name -> ref)) }