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

fix unsigned int error in update #4434

Merged
merged 2 commits into from
Nov 28, 2023
Merged

fix unsigned int error in update #4434

merged 2 commits into from
Nov 28, 2023

Conversation

aryairani
Copy link
Contributor

@aryairani aryairani commented Nov 28, 2023

This subtle bug was bad. This PR includes the failure case as a transcript.

Arya Irani added 2 commits November 22, 2023 16:33
@aryairani aryairani requested a review from ceedubs November 28, 2023 03:14
in if Map.size m == ctorCountGuess && all (isJust . flip Map.lookup m) [0 .. fromIntegral ctorCountGuess - 1]
in if Map.size m == ctorCountGuess && all (isJust . flip Map.lookup m . fromIntegral) [0 .. ctorCountGuess - 1]
Copy link
Contributor Author

@aryairani aryairani Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was somehow counting up from [0 .. unsigned(-1)] instead of [0 .. -1] and then quietly failing the all.

Copy link
Contributor

@ceedubs ceedubs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 this fixed the issue that I was running into. Thank you!

@aryairani
Copy link
Contributor Author

aryairani commented Nov 28, 2023

I'm actually confused as to how any type updates were working with this bug.
Oh, the result for type updates with more than 0 existing constructors I guess would not have wrapped around with the -1. 👍

@aryairani aryairani merged commit 060b0c2 into trunk Nov 28, 2023
7 checks passed
@aryairani aryairani deleted the fix/update-new-record branch November 28, 2023 12:58
@aryairani aryairani changed the title fix #4425 fix unsigned int error in update Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants