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
The equality operator = returns true in Fable but false in .NET for structurally equal ResizeArrays.
letxs= ResizeArray([0;1;2])letys= ResizeArray([0;1;2])
printfn "ResizeArray: %b"(xs=ys)// true in Fable, false in .NETletxxs=[|0;1;2|]letyys=[|0;1;2|]
printfn "Array: %b"(xxs=yys)// true in both Fable and .NET
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).
The text was updated successfully, but these errors were encountered:
@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.
goswinr
changed the title
Equality or ResizeArrays different in .NET and Fable
Equality of ResizeArrays different in .NET and Fable
Jan 26, 2024
The equality operator
=
returnstrue
in Fable butfalse
in .NET for structurally equal ResizeArrays.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).
The text was updated successfully, but these errors were encountered: