Why do I need to Cast Visitor Object to Dynamic for Double Dispatch?
问题 I'd like to know why I need to cast both my visitable object and my visitor to dynamics in order for double dispatch to work without repeated overloads of the Accept method. If I cast either to dynamic but not the other, the generic base class's visit method is called. But if I cast both, then sub-classes' visit methods are called. I have implemented the standard visitor pattern with generics. I have a visitor interface as follows: public interface ITreeVisitorVoid<TPayload> { void Visit