Short-circuit evaluation does not work with subroutines
Open
GAPIL
P3
triaged
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
The gapil resolver moves subroutine calls out of expressions so that aborts can be handled.
However, this breaks short-circuit evaluation. Consider:
```
x := y && SubWithSideEffect()
```
This will be transformed to:
```
tmp := SubWithSideEffect()
// logic to check SubWithSideEffect did not abort
x := y && tmp
```
This is very tricky to fix with the current template codegen, but far easier to solve with the new compiler.
Contributor guide
Assessment
This issue has not been assessed yet.