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

succ, pred, inc and dec accept some integers instead of int #22470

Closed
wants to merge 2 commits into from

Conversation

ringabout
Copy link
Member

supersedes #22457

@konsumlamm
Copy link
Contributor

This is better than #22457, but I'd still prefer nim-lang/checksums#6. +/+= don't allow different argument types for good reason imo. This also breaks the JS backend, which relies on the second argument always being an int. This could be solved by only using the magic if the second argument is an int (i.e. adding an overload for SomeInteger, that doesn't use the magic).

@ringabout
Copy link
Member Author

Unrelated CI failure.

@ringabout
Copy link
Member Author

This could be solved by only using the magic if the second argument is an int (i.e. adding an overload for SomeInteger, that doesn't use the magic).

Feel free to improve that in the following PRs. I need this to unblock #22453

@konsumlamm
Copy link
Contributor

Again, what's the problem with nim-lang/checksums#6?

@ringabout
Copy link
Member Author

Well, not like I object to my own PR. Either one is fine to merge.

@Araq
Copy link
Member

Araq commented Aug 14, 2023

The signature is inc(Ordinal, int) etc, I don't know why this is debatable.

@konsumlamm
Copy link
Contributor

The signature is inc(Ordinal, int) etc, I don't know why this is debatable.

That's how it originally was and currently is (without this PR or #22457), but checksums apparently relied on it also accepting uint64 as second argument, while the signature was inc[T: Ordinal, V: Ordinal](T, V).

@ringabout ringabout closed this Aug 17, 2023
@ringabout
Copy link
Member Author

nim-lang/checksums#6 was merged

@ringabout ringabout deleted the pr_inc_integer branch August 17, 2023 12:02
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.

3 participants