How do I use Reflection.Emit to produce code similar to this?
public void bar<T>()
{
}
public void foo<J>()
{
bar<J>();
}
More specifically, I don't know how to bind the method call using
Reflection.Emit .
Any suggestions?
The IL that is generated is:
..method public hidebysig instance void foo<J>() cil managed
{
// Code Size: 9 byte(s)
.maxstack 8
L_0000: nop
L_0001: ldarg.0
L_0002: call instance void dempo::bar<!!0> ()
L_0007: nop
L_0008: ret
}
But I don't see a way to get the !!0 from Reflection.Emit .