Im working on supporting virtual functions in NimForUE and I have a POC working fine. The issue that I have is that I need to generate all the cpp fields by hand, I was wondering if there is a way to reuse the compiler work (maybe via the compiler API) so I dont have to rewrite all of it, especially because for some types there is a suffix appended so it doesnt collide with the original and for other types we use the original. I could work around it but the idea is to reuse what's already done.
Thanks,
For now, for uClasses, Im focussed on the functions because they dont really have fields (the interop is done via the reflection API) but for uStructs they do. What Im doing for the functions (and plan to do for the parameters/fields too) is just to generate cpp code at Nim macro time. Im already doing the opposite to convert UE C++ types to Nim.
I also want to support const so the overwritten function matches. What I would want ideally if I can pass over the type information as in a symbol/ident to the compiler API and get the code that Nim would generate for it. But I guess that just doesnt exist, maybe a compiler plugin could enable something like that (since you have access to the module info)? But it seems you cant add plugin without recompiling the sources anyways..