-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4605 from unisonweb/24-01-10-fix-upgrade-suffixifier
- Loading branch information
Showing
3 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
```ucm:hide | ||
.> project.create-empty myproject | ||
myproject/main> builtins.merge | ||
myproject/main> move.namespace builtin lib.builtin | ||
``` | ||
|
||
```unison | ||
lib.old.foo = 25 | ||
lib.new.foo = +30 | ||
a.x.x.x.x = 100 | ||
b.x.x.x.x = 100 | ||
c.y.y.y.y = lib.old.foo + 10 | ||
d.y.y.y.y = lib.old.foo + 10 | ||
bar = a.x.x.x.x + c.y.y.y.y | ||
``` | ||
|
||
```ucm | ||
myproject/main> add | ||
``` | ||
|
||
```ucm:error | ||
myproject/main> upgrade old new | ||
``` | ||
|
68 changes: 68 additions & 0 deletions
68
unison-src/transcripts/upgrade-suffixifies-properly.output.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
```unison | ||
lib.old.foo = 25 | ||
lib.new.foo = +30 | ||
a.x.x.x.x = 100 | ||
b.x.x.x.x = 100 | ||
c.y.y.y.y = lib.old.foo + 10 | ||
d.y.y.y.y = lib.old.foo + 10 | ||
bar = a.x.x.x.x + c.y.y.y.y | ||
``` | ||
|
||
```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.x.x.x.x : Nat | ||
b.x.x.x.x : Nat | ||
bar : Nat | ||
c.y.y.y.y : Nat | ||
d.y.y.y.y : Nat | ||
lib.new.foo : Int | ||
lib.old.foo : Nat | ||
``` | ||
```ucm | ||
myproject/main> add | ||
⍟ I've added these definitions: | ||
a.x.x.x.x : Nat | ||
b.x.x.x.x : Nat | ||
bar : Nat | ||
c.y.y.y.y : Nat | ||
d.y.y.y.y : Nat | ||
lib.new.foo : Int | ||
lib.old.foo : Nat | ||
``` | ||
```ucm | ||
myproject/main> upgrade old new | ||
I couldn't automatically upgrade old to new. However, I've | ||
added the definitions that need attention to the top of | ||
scratch.u. | ||
``` | ||
```unison:added-by-ucm scratch.u | ||
bar : Nat | ||
bar = | ||
use Nat + | ||
a.x.x.x.x + c.y.y.y.y | ||
d.y.y.y.y : Nat | ||
d.y.y.y.y = | ||
use Nat + | ||
foo + 10 | ||
c.y.y.y.y : Nat | ||
c.y.y.y.y = | ||
use Nat + | ||
foo + 10 | ||
``` | ||
|