mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 10:35:57 +03:00
35 lines
578 B
Markdown
35 lines
578 B
Markdown
|
|
```ucm:hide
|
|
scratch/main> builtins.merge
|
|
```
|
|
|
|
This tests a variable related bug in the ANF compiler.
|
|
|
|
The nested let would get flattened out, resulting in:
|
|
|
|
bar = result
|
|
|
|
which would be handled by renaming. However, the _context_ portion of
|
|
the rest of the code was not being renamed correctly, so `bar` would
|
|
remain in the definition of `baz`.
|
|
|
|
```unison
|
|
foo _ =
|
|
id x = x
|
|
void x = ()
|
|
bar = let
|
|
void (Debug.watch "hello" "hello")
|
|
result = 5
|
|
void (Debug.watch "goodbye" "goodbye")
|
|
result
|
|
baz = id bar
|
|
baz
|
|
|
|
> !foo
|
|
```
|
|
|
|
```ucm
|
|
scratch/main> add
|
|
```
|
|
|