You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GetHashCode would cause infinite loop, please consider to fix it.
My workaround:
override x.GetHashCode() =
let rec jsonValue (this:Json) =
match this with
| Array v -> box (v |> List.map (fun j -> jsonValue j) |> Array.ofList)
| True -> box true
| False -> box false
| Null -> null
| Number v ->
match System.Int32.TryParse v with
| true, i -> box i
| false, _ ->
match System.Int64.TryParse v with
| true, i64 -> box i64
| false, _ ->
match bigint.TryParse v with
| true, bi -> box bi
| false, _ ->
match System.Decimal.TryParse v with
| true, d -> box d
| false, _ ->
match System.Single.TryParse v with
| true, s -> box s
| false, _ ->
match System.Double.TryParse v with
| true, db -> box db
| false, _ -> box v
| Object (WriteObject v) ->
let s = v |> Seq.map (fun (k, j) -> k, jsonValue j)
s |> Map |> box
| Object (ReadObject (_, v)) ->
let s = v |> Seq.map (fun kvp -> kvp.Key, jsonValue kvp.Value)
s |> Map |> box
| String v -> box v
jsonValue x |> hash
The text was updated successfully, but these errors were encountered:
GetHashCode would cause infinite loop, please consider to fix it.
My workaround:
The text was updated successfully, but these errors were encountered: