Thanks for pointing me to that thread, that explains some of the details I did not yet grasp.
For now I'm good with a bit of redesign: I store a ref to object with some proc pointers for that specific type in each node. If this is solvable with a macro I can save a pointer per object though, which would be nice.