'type' : invalid target type for name
A casting operator tried to convert to a type that is not a pointer or reference. The dynamic_cast operator can be used only for pointers or references.
Example
class A { virtual void f(); }; class B : public A {}; void g(B b) { A a; a = dynamic_cast<A>(b); // error }