Open 0x0f0f0f opened 3 years ago
Unfortunately I don't know how to do this in full generality, otherwise I'd already have done it. It's semi-possible to do as a side-effect at macro expansion time if people only use the single-argument @RuntimeGeneratedFunction
constructor. These kind of side-effectful macros are somewhat evil, however ;-) Furthermore, this wouldn't work for the other constructor forms.
The ability of RGFs to avoid world age errors is entirely tied to running the init code early - the init code defines a generated function with an early world age which all dynamically generated RGFs will inherit.
So yeah, to be more blunt - I don't think this is possible :-)
Is it technically possible?
If I do this right before generating a function I get a world age error.