Add transcript demonstrating #4556

This commit is contained in:
Travis Staton 2024-01-05 11:21:43 -05:00
parent 493dd6874f
commit 3c7101c105
No known key found for this signature in database
GPG Key ID: 431DD911A00DAE49
2 changed files with 102 additions and 0 deletions

View File

@ -0,0 +1,22 @@
```ucm:hide
.> builtins.merge
```
```unison
thing = 3
foo.hello = 5 + thing
bar.hello = 5 + thing
hey = foo.hello
```
```ucm
.> add
```
```unison
thing = 2
```
```ucm:error
.> update
```

View File

@ -0,0 +1,80 @@
```unison
thing = 3
foo.hello = 5 + thing
bar.hello = 5 + thing
hey = foo.hello
```
```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`:
bar.hello : Nat
foo.hello : Nat
hey : Nat
thing : Nat
```
```ucm
.> add
⍟ I've added these definitions:
bar.hello : Nat
foo.hello : Nat
hey : Nat
thing : Nat
```
```unison
thing = 2
```
```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 names already exist. You can `update` them to your
new definition:
thing : Nat
```
```ucm
.> update
Okay, I'm searching the branch for code that needs to be
updated...
That's done. Now I'm making sure everything typechecks...
hey : Nat
hey = hello
foo.hello : Nat
foo.hello =
use Nat +
5 + thing
bar.hello : Nat
bar.hello =
use Nat +
5 + thing
thing = 2
Typechecking failed. I've updated your scratch file with the
definitions that need fixing. Once the file is compiling, try
`update` again.
```