FSharp.Json icon indicating copy to clipboard operation
FSharp.Json copied to clipboard

Round tripping an union type with a single string field throws an exception

Open mrakgr opened this issue 5 years ago • 0 comments

open FSharp.Json

type ClientMsgs =
    | ProjectDir of string

Json.serialize (ProjectDir "qwe") |> Json.deserialize |> fun (x : ClientMsgs) -> x |> printfn "%A"

This throwing an exception surprised me. I guess I'll try adding a second field.

Edit: That works around the issue.

mrakgr avatar Jun 08 '20 13:06 mrakgr