Object variants are actually pretty interesting here. I need to basically define a set of fields that assignments are allowed to for each `kind` an object variant can be. Based on that set of fields I can then generate assignments ala `result.<fieldName> = source.<fieldName>` and insert them at the start of the proc-body.
I only have the fieldName available at runtime though, so I basically have to generate a switch-case-statement that tries to transfer over all the fields it can from object type A to variant type B for every possible kind that B can be. Oooff that sounds not that easy. Particularly first figuring out the given list of fields (or rather field-names) for each kind. But maybe there's a way to do this via proc and I generate a call to that proc...
