The behavior described is also the same in VS2015 Update 3:
So this is not a regression.
We could only do this with our own debugger engine which was aware of F# types
@gregg-miskelly just to check - is this another case of "F# needs its own EE"?
Correct
link #2544
I just wasted an hour due to this issue.
> printfn "%A" None;;
<null>
val it : unit = ()
> printfn "%A" null;;
<null>
val it : unit = ()
>
Supremely confusing when you're looking at server logs for things that you think should be Options.
@samuela What you describe is not this issue. This issue is about the representation of None in debugging tools.
What you're observing is thatNone emits as null in IL, which explains why you'd see that as the value in logs. As a remediation, I'd recommend sending all logs through a function that does a check for options, emitting something else for the None case. You can check like this:
let inline isOptionType (t:System.Type) =
t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() = typedefof<option<_>>