Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Records containing different values return the same hash #3648

Closed
HLWeil opened this issue Dec 9, 2023 · 1 comment · Fixed by #3650
Closed

[Python] Records containing different values return the same hash #3648

HLWeil opened this issue Dec 9, 2023 · 1 comment · Fixed by #3650
Assignees
Labels

Comments

@HLWeil
Copy link

HLWeil commented Dec 9, 2023

Description

Records containing different values return the same hash

Repro code

test.fsx

type X = {ID :int}

let x1 = {ID = 1}
let x2 = {ID = 2}

printfn $"x1:{x1.GetHashCode()}"
printfn $"x2:{x2.GetHashCode()}"

test.cmd

dotnet fable . --lang python
python test.py

Expected and actual results

Expected result: Different hashes

Actual result: Same hashes

x1:5740354900026072187
x2:5740354900026072187

Related information

Equality with = does work and returns false.

  • dotnet fable --version: 4.5.0
  • dotnet tool list/update/install: 4.7.0
  • Windows11

@Freymaurer

@dbrattli
Copy link
Collaborator

dbrattli commented Dec 9, 2023

Thanks for the bug report. This issue will be fixed in the next release of Fable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants