Closed nicolasprevot closed 2 years ago
it is most likely that F# has compiled the delegate into another class/method. use ILSpy to have a look at what the f# compiles to. u can use the IL option
Hello,
As you can read from the instructions, the F# compiler encodes the AST as a byte[] that is deserialized at runtime.
There's not much Cecil can do here, you can read the byte[] InitialValue
property from the field that is loaded, but that's going to be on you to decode what the byte[] array means.
Thanks!
I am working on a program which, among other things, lists the method calls done within the body of a method.
Given the C# program:
The instructions (listed by mono cecil) of the body of the Main method include: 'IL_0031: ldtoken System.Int32 System.Collections.Generic.ICollection`1::get_Count()
which is what I want
However, given the equivalent F# program:
The instructions (listed by mono cecil) of the body of the main method do not include the get_Count() method They include things like:
Is there any way to get mono cecil to list the get_Count() method in this case?