Get _all_ annotations on a TypeNode

Has anyone come across an approach to get all annotations that are applied to a TypeNode?

I’m familiar with Crystal::Macros::TypeNode#annotations, however this is limited to pulling annotations of a specific type. I’m trying to solve a scenario where I have the need to copy annotations between types, where the types of these annotations are unknown.

Doesn’t exist yet, but you can go bump Add #all_annotations, and Annotation#name macro methods by Blacksmoke16 · Pull Request #9326 · crystal-lang/crystal.

1 Like