ActorSystem.create in akka documentation

At documentation page

ActorRef testSystem = ActorSystem.create(Main.create(), “testSystem”);

create returns ActorSystem. How is this assignment legal then?

The typed ActorSystem is also the actor ref of the user guardian actor.

That code snippet isn’t from the docs though, the Java sample in the doc is:

ActorRef<String> testSystem = ActorSystem.create(Main.create(), "testSystem");

Note the type parameter on the actor ref which is what kind of message the root actor accepts.

2 Likes