You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update ignores definitions in watch expressions entirely.
```ucm:hide
scratch/main> builtins.merge lib.builtins
```
```unison
foo = 1
```
```ucm
scratch/main> update
```
```unison
> foo = 2
```
```ucm
scratch/main> update
scratch/main> view foo
```
---
Initial state:
```unison
a = 1
b = 2
x = a + b
```
```ucm
scratch/main> update
```
Make a type-changing update to a dependency of `x`,
also update `x`, but it's in a watch expression 👀
```unison
a = "foo"
b = "bar"
> x = a ++ b
```
```ucm
scratch/main> update
```
Output:
``` unison
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`:
foo : Nat
```
``` ucm
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
```
``` unison
> foo = 2
```
``` ucm
Loading changes detected in scratch.u.
✅
scratch.u changed.
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
1 | > foo = 2
⧩
2
```
``` ucm
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
scratch/main> view foo
foo : Nat
foo = 1
```
-----
Initial state:
``` unison
a = 1
b = 2
x = a + b
```
``` 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`:
a : Nat
(also named foo)
b : Nat
x : Nat
```
``` ucm
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...
Done.
```
Make a type-changing update to a dependency of `x`,
also update `x`, but it's in a watch expression 👀
``` unison
a = "foo"
b = "bar"
> x = a ++ b
```
``` 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:
a : Text
(The old definition is also named foo.)
b : Text
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
3 | > x = a ++ b
⧩
"foobar"
```
``` ucm
scratch/main> update
Okay, I'm searching the branch for code that needs to be
updated...
That's done. Now I'm making sure everything typechecks...
Typechecking failed. I've updated your scratch file with the
definitions that need fixing. Once the file is compiling, try
`update` again.
```
🛑
The transcript failed due to an error in the stanza above. The error is:
Typechecking failed. I've updated your scratch file with the
definitions that need fixing. Once the file is compiling, try
`update` again.
The text was updated successfully, but these errors were encountered:
update
ignores definitions in watch expressions entirely.Output:
The text was updated successfully, but these errors were encountered: