0

Related Is it possible to call a DynamicMethod from MethodBuilder/ConstructorBuilder

I have the same problem. However I can't use the same solution (which is to emit an instance method instead of a DynamicMethod) because my DynamicMethod results in a closure. Is there a different solution than the one provided that allows me to use a closure or equivalent?

I have one idea for a solution which is to still generate a closure class and assign all variables to the closure as normal, then generate an instance method that takes in the closure class or create an instance method on the closure class itself.

Alex Q
  • 125
  • 6
  • Can you just add an extra parameter to your method instead of using a closure? – Brannon Dec 16 '20 at 13:10
  • @Brannon Unfortunately no. It must be a closure. The method being called is out of my control and is written in a way that expects a closure. – Alex Q Dec 16 '20 at 20:32

0 Answers0