I would like to emit a method that has a variable, which I can do. But, I would like to store in that variable a MethodInfo object, which is a reference to a different (non emitted) method.
I could emit the opcodes to call typeof(someClass).GetMethod(...), but it would be more efficient if I could simply load a token for this MethodInfo and bake it directly into the variable.
So, to rephrase, I'm trying to find out of its possible to emit , let's say a "load object" opcode and pass it an object at emit-time that will be loaded onto the stack at runtime. (OpCodes.Ldobj gave some kind of error when I tried this). Or, am I forced to emit opcodes that will do this at runtime?
infoof
, not how it could be implemented. – Transubstantiate