we have plenty of mess in type casting.
For more see !621 (comment 522538615) and !618 (merged)
Short version:
It would really help in debugging of tricky crashes if we had a cmake option to switch between two cast types. This option is unavailable now, we have plenty of mess actually: some macros in Math.hpp #97, and some uses of static_cast and dynamic_cast in other places.
Possible solution to investigate:
there may be a way around it, using class Indexable. Do integer comparison of index to check if cast can be done + static_cast instead of calling dynamic_cast. That will be another MR, when I will think it through, how to make it work.