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

if foo() is Some(x) runs foo() twice #1450

Open
sophiajt opened this issue Jun 21, 2023 · 0 comments
Open

if foo() is Some(x) runs foo() twice #1450

sophiajt opened this issue Jun 21, 2023 · 0 comments

Comments

@sophiajt
Copy link
Collaborator

The codegen for an if like:

if foo() is Some(x) { ... }

Will run foo() twice, causing the side effects it causes twice. We should only run the expression once in the codegen.

cc @fahrradflucht

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 a pull request may close this issue.

1 participant