mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
This is for consistency with the `cmark` style. Now the blocks we still pretty-print ourselves will match the bulk of them that `cmark` produces.
69 lines
1.2 KiB
Markdown
69 lines
1.2 KiB
Markdown
# Block on required update
|
|
|
|
Should block an `add` if it requires an update on an in-file dependency.
|
|
|
|
``` unison
|
|
x = 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`:
|
|
|
|
x : Nat
|
|
|
|
```
|
|
``` ucm
|
|
scratch/main> add
|
|
|
|
⍟ I've added these definitions:
|
|
|
|
x : Nat
|
|
|
|
```
|
|
Update `x`, and add a new `y` which depends on the update
|
|
|
|
``` unison
|
|
x = 10
|
|
y = x + 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`:
|
|
|
|
y : Nat
|
|
|
|
⍟ These names already exist. You can `update` them to your
|
|
new definition:
|
|
|
|
x : Nat
|
|
|
|
```
|
|
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
|
|
|
|
``` ucm
|
|
scratch/main> add y
|
|
|
|
x These definitions failed:
|
|
|
|
Reason
|
|
needs update x : Nat
|
|
blocked y : Nat
|
|
|
|
Tip: Use `help filestatus` to learn more.
|
|
|
|
```
|