unison/unison-src/transcripts/anf-tests.output.md

56 lines
1010 B
Markdown
Raw Permalink Normal View History

This tests a variable related bug in the ANF compiler.
The nested let would get flattened out, resulting in:
2024-07-15 21:10:27 +03:00
```
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
2022-12-02 08:51:11 +03:00
void x = ()
bar = let
2022-12-02 08:51:11 +03:00
void (Debug.watch "hello" "hello")
result = 5
2022-12-02 08:51:11 +03:00
void (Debug.watch "goodbye" "goodbye")
result
baz = id bar
baz
> !foo
```
``` ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
foo : ∀ _. _ -> Nat
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
2022-12-02 08:51:11 +03:00
12 | > !foo
5
```
``` ucm
scratch/main> add
⍟ I've added these definitions:
foo : ∀ _. _ -> Nat
```