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
If a record type with custom equality and hashcode is included in another type, calling the equality on the outer type returns false, possibly because custom equality of inner type is not used.
Possibly related to #3674, which works like a charm now, thank you!
Repro code
test.fsx
[<CustomEquality; NoComparison>]typeX={
ID :int
Name :string }overridex.GetHashCode()= x.ID
overridethis.Equals(other :obj)=match other with|:? X as other -> this.ID = other.ID
|_->false// Record type here (unlike issue #3674)typeY={X :X}// Should be equal according to custom equalityletx1={ID =1; Name ="a"}letx2={ID =1; Name ="b"}// Should all be equal according to custom equality of inner typelety1={X = x1}lety2={X = x2}lety3={X = x1}
printfn $"x1=x2:{x1 = x2}"// true
printfn $"y1=y2:{y1 = y2}"// incorrectly false
printfn $"y1=y3:{y1 = y3}"// correctly true, possibly because equal by non-custom equality
test.cmd
dotnet fable . --lang python
python test.py
Expected and actual results
Expected: Everything should be true.
Actual: Two records containing a only a record each that should be equal by custom equality still returns false
Description
If a record type with custom equality and hashcode is included in another type, calling the equality on the outer type returns false, possibly because custom equality of inner type is not used.
Possibly related to #3674, which works like a charm now, thank you!
Repro code
test.fsx
test.cmd
dotnet fable . --lang python python test.py
Expected and actual results
Expected: Everything should be true.
Actual: Two records containing a only a record each that should be equal by custom equality still returns false
Related information
dotnet fable --version
: 4.10.0dotnet tool list/update/install
: 4.10.0@Freymaurer
The text was updated successfully, but these errors were encountered: