roc/crates/compiler/test_mono
Ayaz Hafiz 078f0147ee
Do not bind accessors in toplevel thunks to their thunks' names
In #3352 an optimization to transform `ra = .field` into

```
ra = \#rcd -[ra]-> #rcd.field
```

rather than

```
__ra1 = \#rcd -[__ra1] -> #rcd.field

ra = LambdaSet { __ra1 }
```

was introduced. However, this optimization is not correct when `ra =
.field` is defined as a toplevel thunk, for in such situations we
indeed want the thunk `ra` to return the lambda set it resolves to,
rather than repointing at itself.

Besides reverting this change, another option would be to convert
accessors into closures before translation of Can to IR. However, this
complicates the translation algorithm more than it already is, and I'd
like to avoid additional special-cases.

Closes #4606
2022-12-02 08:50:03 -06:00
..
generated Do not bind accessors in toplevel thunks to their thunks' names 2022-12-02 08:50:03 -06:00
src Do not bind accessors in toplevel thunks to their thunks' names 2022-12-02 08:50:03 -06:00
Cargo.toml Provide roc_cache_dir everywhere 2022-11-20 19:53:48 -05:00