Skip to content

Commit

Permalink
Merge pull request #5270 from unisonweb/arya/fix-3424
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani authored Aug 10, 2024
2 parents 096aeea + c4f8ffc commit d5d9d9d
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions unison-cli/src/Unison/Codebase/Editor/HandleInput/Update2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Unison.Codebase.Editor.HandleInput.Update2
)
where

import Control.Lens ((.=))
import Control.Monad.RWS (ask)
import Data.Bifoldable (bifoldMap)
import Data.List qualified as List
Expand Down Expand Up @@ -148,6 +149,7 @@ handleUpdate2 = do
(\typeName -> Right (Map.lookup typeName declNameLookup.declToConstructors))
secondTuf
Cli.stepAt "update" (path, Branch.batchUpdates branchUpdates)
#latestTypecheckedFile .= Nothing

Cli.respond Output.Success

Expand Down
26 changes: 26 additions & 0 deletions unison-src/transcripts/fix3424.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```ucm
scratch/main> builtins.merge lib.builtins
```

```unison:hide
a = do b
b = "Hello, " ++ c ++ "!"
c = "World"
```

```ucm
scratch/main> add
scratch/main> run a
```

```unison:hide
a = do b
c = "Unison"
```

```ucm
scratch/main> update
scratch/main> run a
```

The result should be "Hello, Unison!".
50 changes: 50 additions & 0 deletions unison-src/transcripts/fix3424.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
``` ucm
scratch/main> builtins.merge lib.builtins
Done.
```
``` unison
a = do b
b = "Hello, " ++ c ++ "!"
c = "World"
```

``` ucm
scratch/main> add
⍟ I've added these definitions:
a : 'Text
b : Text
c : Text
scratch/main> run a
"Hello, World!"
```
``` unison
a = do b
c = "Unison"
```

``` 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...
Everything typechecks, so I'm saving the results...
Done.
scratch/main> run a
"Hello, Unison!"
```
The result should be "Hello, Unison\!".

0 comments on commit d5d9d9d

Please sign in to comment.