mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 02:25:39 +03:00
add "constructor alias" precondition violation example
This commit is contained in:
parent
a08f509aa5
commit
7455187b43
@ -425,3 +425,28 @@ proj/main> merge2 /topic
|
||||
```ucm:hide
|
||||
.> project.delete proj
|
||||
```
|
||||
|
||||
### Constructor alias
|
||||
|
||||
```ucm:hide
|
||||
.> project.create-empty proj
|
||||
proj/main> builtins.mergeio
|
||||
```
|
||||
|
||||
```unison
|
||||
unique type Foo = Bar
|
||||
```
|
||||
|
||||
```ucm
|
||||
proj/main> add
|
||||
proj/main> branch topic
|
||||
proj/topic> alias.term Foo.Bar Foo.Alias
|
||||
```
|
||||
|
||||
```ucm:error
|
||||
proj/main> merge2 /topic
|
||||
```
|
||||
|
||||
```ucm:hide
|
||||
.> project.delete proj
|
||||
```
|
||||
|
@ -885,3 +885,49 @@ proj/main> merge2 /topic
|
||||
Defns in lib
|
||||
|
||||
```
|
||||
### Constructor alias
|
||||
|
||||
|
||||
```unison
|
||||
unique type Foo = Bar
|
||||
```
|
||||
|
||||
```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`:
|
||||
|
||||
type Foo
|
||||
|
||||
```
|
||||
```ucm
|
||||
proj/main> add
|
||||
|
||||
⍟ I've added these definitions:
|
||||
|
||||
type Foo
|
||||
|
||||
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.
|
||||
|
||||
proj/topic> alias.term Foo.Bar Foo.Alias
|
||||
|
||||
Done.
|
||||
|
||||
```
|
||||
```ucm
|
||||
proj/main> merge2 /topic
|
||||
|
||||
On topic, Foo.Alias and Foo.Bar are aliases. Every type
|
||||
declaration must have exactly one name for each constructor.
|
||||
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user