My regression tests for #513 have shown up the following inconsistency in existing f#:
printfn "%d" <| (ComparisonIdentity.Structural.Compare (SByte.MinValue, SByte.MaxValue))
printfn "%d" <| (ComparisonIdentity.Structural.Compare (Some SByte.MinValue, Some SByte.MaxValue))
Output
It is due to FSharpOption's type generic call to:
LanguagePrimitives.HashCompare.GenericComparisonWithComparerIntrinsic<T>(genericComparer, x, y);
Now I doubt if anyway is using comparers in any other way than < 0 or > 0, but they may be? #513 is a potentially breaking change because it returns -1 for the Option case - i.e. matching the primitive operation (although the affects of this breaking case, to Option comparison operations being sensitive to particular return values - is almost vanishingly small I would say..)
(The good news is that if in my regression limits Compare to (sign of Compare) then I'm getting no regression errors. I'll put my regression test up soon)
My regression tests for #513 have shown up the following inconsistency in existing f#:
Output
It is due to FSharpOption's type generic call to:
Now I doubt if anyway is using comparers in any other way than < 0 or > 0, but they may be? #513 is a potentially breaking change because it returns -1 for the Option case - i.e. matching the primitive operation (although the affects of this breaking case, to Option comparison operations being sensitive to particular return values - is almost vanishingly small I would say..)
(The good news is that if in my regression limits Compare to (sign of Compare) then I'm getting no regression errors. I'll put my regression test up soon)