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: small fixes for DynSolValue strategies #683

Merged
merged 4 commits into from
Jul 4, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Jul 4, 2024

Motivation

  • adjust_integer was always zeroing out top-most 256 - size bits, thus resulting in incorrect values in some cases. Example for int8 case: -1 & ((1 << 8) - 1) = 255 which overflows int8. This PR changes it to correctly handle sign and set higher bits to 1 in cases when we end up with a negative value.
  • strategies for CustomStruct were generating duplicating field names in certain cases, also value strategy for CustomStruct types was generating different field names for every instance.

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@klkvr klkvr requested a review from prestwich as a code owner July 4, 2024 13:45
@DaniPopes DaniPopes merged commit 7713661 into alloy-rs:main Jul 4, 2024
30 checks passed
klkvr added a commit that referenced this pull request Aug 4, 2024
* fix: arbitrary for integer types

* better strategies for custom types

* rm regressions

* rm newline
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