Downcast traits inside Rc for AST manipulation
Note: In this answer I will use the dyn Trait syntax to make it more clear when a type is a trait object. The older way to write Rc<dyn Trait> is Rc<Trait>. See What does “dyn” mean in a type? No, you can’t downcast Rc<dyn Trait> to Rc<Concrete>, because trait objects like dyn Trait don’t … Read more