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
is subtype of Actor
and ClassTag
, but how to know, that T
has to be an object?