jakt icon indicating copy to clipboard operation
jakt copied to clipboard

`if foo() is Some(x)` runs foo() twice

Open sophiajt opened this issue 1 year ago • 0 comments

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

sophiajt avatar Jun 21 '23 17:06 sophiajt