effekt-lang / effekt-lang/effekt
Region of local mutable variables disagrees with llvm backend semantics
Open
area:typer
bug
- Dominant language
- Scala
- Stars
- 469
- Forks
- 41
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 23
Description
Consider the following program:
```
def test3(): Int = {
val f = {
var l = 1;
box { l }
}
f()
}
def main() = println(test3())
```
It should print `1`, which it does. Except when run with `effekt --backend=llvm --no-optimize`, where it prints
`105971318358032`, some garbage value. The local mutable variable `l` escapes its region, which in the llvm backend operationally is only until the end of the local compound statement (block).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.