Why do I have to pass new keyword?
问题 I have the following code: val fsm = TestFSMRef(new SenderCollectorFsm) And do not understand, why do I have to pass to TestFSMRef an instance. Lets look at the definition of TestFSMRef: object TestFSMRef { def apply[S, D, T <: Actor: ClassTag]( factory: => T)(implicit ev: T <:< FSM[S, D], system: ActorSystem): TestFSMRef[S, D, T] = { val impl = system.asInstanceOf[ActorSystemImpl] new TestFSMRef(impl, Props(factory), impl.guardian.asInstanceOf[InternalActorRef], TestActorRef.randomName) } T