Wednesday, February 17, 2010

F# under the covers XII -- Reflector 6.0 decompilation to C#

A new Reflector release (6.0.0.918), and time to see whether it can approximate in C# some compiled F# code that the 5.1.6.0 version balked at.

The generated IEquatable.Compare method that couldn't be handled before now succeeds -- the section that had problems now resolves to


and it's not surprising that comparing not-greater-than-null might be an unexpected piece of IL.

However, when there is a problem with decompilation, the new version no longer provides the detail of which instruction it didn't like. So I don't know why this

raises an error report when trying to decompile to C# (or MC++ or VB); or why this

throws a NullPointerException while trying to report an error when asked to decompile it as C# (I was able to get an error report sent when asking for VB instead).

Dropping back to 5.1.6.0, both show the usual "invalid branching condition", and point to

(the former condition) and

respectively, on the path where we are short-circuiting, as in

where the last line here is the one that the decompilation faults on.

No comments :