Why does the F # debugger lie?

Can someone explain to me why the VS2012 debugger shows different values ​​for the same member of an object? (See Figure)

http://s2.uploads.ru/jlkw0.png (Sorry for the VS non-engs interface, but I think the situation is clear.)

Here is the code:

http://pastie.org/7186239

+6
source share
1 answer

Debugging experience does not seem to do well in determining the correct binding for identifiers. In your example, this means that any identifier named Source really shows the value of this.Source , and not the corresponding property of the correct object. Note that you can get the correct value by hovering over y and expanding the members (although this is obviously not a lot of experience).

There are even more confusing ways that this issue manifests itself:

 type T() = member val P = 1 member this.DoSomething() = let P = "test" // set breakpoint here, hover over P printfn "%i" this.P // set breakpoint here, hover over P T().DoSomething() 

Now, depending on which instance of P you are pointing at yourself, you are mistaken!

+8
source

All Articles