add "stray constructor" precondition violation example

This commit is contained in:
Travis Staton 2024-03-19 11:27:47 -04:00
parent 06cc4e84e4
commit 9f7c2e2653
No known key found for this signature in database
GPG Key ID: 431DD911A00DAE49
2 changed files with 69 additions and 0 deletions

View File

@ -507,3 +507,28 @@ proj/main> merge2 /topic
```ucm:hide
.> project.delete proj
```
### Stray 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 Stray
```
```ucm:error
proj/main> merge2 /topic
```
```ucm:hide
.> project.delete proj
```

View File

@ -1043,3 +1043,47 @@ proj/main> merge2 /topic
Nested decl alias.
```
### Stray 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 Stray
Done.
```
```ucm
proj/main> merge2 /topic
Stray constructor.
```