ActorFactory doesn't take into account the types of parameters when creating an actor but only the number of the constructor parameters. For example those two constructors get mismatched:
public InMemoryJournalActor(IDispatcher<Dispatchable<TEntry, TState>> dispatcher)
=> _journal = new InMemoryJournal<T, TEntry, TState>(dispatcher, Stage.World);
public InMemoryJournalActor(IEnumerable<IDispatcher<Dispatchable<TEntry, TState>>> dispatchers)
=> _journal = new InMemoryJournal<T, TEntry, TState>(dispatchers, Stage.World);
The code responsible that needs to be fixed:
foreach (var ctor in definition.Type!.GetConstructors())
{
if (ctor.GetParameters().Length != definitionParameterCount)
continue;
actor = Start(ctor, address, definition, logger);
if(actor != null)
{
break;
}
}
ActorFactory
doesn't take into account the types of parameters when creating an actor but only the number of the constructor parameters. For example those two constructors get mismatched:The code responsible that needs to be fixed: