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(remap): division operations are always fallible #6102

Merged
merged 1 commit into from
Jan 17, 2021

Conversation

StephenWakely
Copy link
Contributor

Spotted here.

Since division by zero can produce an error, division and integer division operations will always be fallible.

Signed-off-by: Stephen Wakely [email protected]

@binarylogic
Copy link
Contributor

Does this mean that assignment expressions must handle the error?

.result, err = 1 / 0

@JeanMertz
Copy link
Contributor

Does this mean that assignment expressions must handle the error?

Correct, unless you either use error coalescing on the rhs, or optional error assignment (once that's added).

@StephenWakely StephenWakely merged commit 7a31489 into master Jan 17, 2021
@StephenWakely StephenWakely deleted the remap_fallible_division branch January 17, 2021 10:20
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