Fable
Fable copied to clipboard
Equality of ResizeArrays different in .NET and Fable
The equality operator = returns true in Fable but false in .NET for structurally equal ResizeArrays.
let xs = ResizeArray([0;1;2])
let ys = ResizeArray([0;1;2])
printfn "ResizeArray: %b" (xs=ys) // true in Fable, false in .NET
let xxs = [|0;1;2|]
let yys = [|0;1;2|]
printfn "Array: %b" (xxs=yys) // true in both Fable and .NET
see REPL
I think this is because they are both compiled to the same JS array. No? If this is intentional then I am happy to update the docs about it (and about sorting too).
@goswinr I don't think it's intentional, it's just that both are implemented with JS arrays, so there is no runtime distinction. We should be able to fix it at compile time, though.