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

add type asserts for MA.operate! return values #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nsajko
Copy link
Contributor

@nsajko nsajko commented Nov 26, 2023

This helps ensure the MutableArithmetics contract is respected. Specifically, MA.operate! should always return its first argument.

Why this instead of performing a stronger check with ===? Because:

  • That would be more verbose
  • The === would sooner have a run time cost than a type assertion

This helps ensure the MutableArithmetics contract is respected.
Specifically, `MA.operate!` should always return its first argument.

Why this instead of performing a stronger check with `===`? Because:

* That would be more verbose
* The `===` would sooner have a run time cost than a type assertion
@blegat
Copy link
Member

blegat commented Dec 4, 2023

Is this improving any benchmark or just some double checks ? In any case, please fix the format error and then it should bz good

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