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: without should work when $ has side effects #58

Merged
merged 1 commit into from
Mar 10, 2024

Conversation

markspanbroek
Copy link
Member

When a type has a $ proc that might produce side effects, then a without statement that tries to bind this type fails with a compilation error:

results.nim(373, 6) Error: 'raiseResultDefect' can have side effects

This fix avoids invoking the raiseResultDefect func by using .unsafeError instead of .error . It's ok to use unsafeError in bindFailed, because we've already checked that the result contains an error.

It's ok to use unsafeError in bindFailed, because we've
already checked that the result contains an error.
@markspanbroek markspanbroek merged commit 57e467b into main Mar 10, 2024
8 checks passed
@markspanbroek markspanbroek deleted the fix-side-effects branch March 10, 2024 11:13
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.

1 participant