add terms in lib precondition violation example

This commit is contained in:
Travis Staton 2024-03-19 10:58:51 -04:00
parent 15e33f439a
commit a08f509aa5
No known key found for this signature in database
GPG Key ID: 431DD911A00DAE49
2 changed files with 107 additions and 0 deletions

View File

@ -388,3 +388,40 @@ proj/main> merge2 /topic
```ucm:hide
.> project.delete proj
```
## Precondition violations
### term in lib
```ucm:hide
.> project.create-empty proj
proj/main> builtins.mergeio
```
```unison
lib.foo : Nat
lib.foo = 1
```
```ucm
proj/main> add
proj/main> branch topic
```
```unison
bonk : Nat
bonk = 5
```
```ucm
proj/topic> add
```
```ucm:error
proj/main> merge2 /topic
```
```ucm:hide
.> project.delete proj
```

View File

@ -815,3 +815,73 @@ bar =
foo + 1
```
## Precondition violations
### term in lib
```unison
lib.foo : Nat
lib.foo = 1
```
```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`:
lib.foo : Nat
```
```ucm
proj/main> add
⍟ I've added these definitions:
lib.foo : Nat
proj/main> branch topic
Done. I've created the topic branch based off of main.
Tip: Use `merge /topic /main` to merge your work back into the
main branch.
```
```unison
bonk : Nat
bonk = 5
```
```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`:
bonk : Nat
```
```ucm
proj/topic> add
⍟ I've added these definitions:
bonk : Nat
```
```ucm
proj/main> merge2 /topic
Defns in lib
```