I'm not very comfortable with C++, and I'm trying to take a stab at resolving an open issue with symbol graph generation for the Documentation generation system. I would appreciate any advice in pointing me in the right direction.
I think the question I have it related to the type GenericTypeDecl
within swiftSymbolGraphGen
. In the issue, @QuietMisdreavus has the advice of converting TD
, which is a pointer to a type of GenericTypeDecl
to the type ClassDecl
, in order to interrogate it to determine if the relevant declaration is an actor or distributed actor.
I'm stumped on how to mechanically do this transformation in C++. I naively tried a C-based cast (TypeDecl)
, but that was a no-go with the compiler. If I'm reading the types correctly (not guaranteed), GenericTypeDecl is derived from TypeDecl, so it seems like there should be a path to interpret it as TypeDecl.
How do you make this kind of conversion in C++?
Or would anyone be willing to point me at relevant reading on where I could learn?