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
delete.term can be used to delete a type's constructor, resulting in an unnamed hash appearing in the type and a result in the todo list.
I think that instead it should fail letting you know that the constructor has references and for bonus points suggesting that you use delete.type on the type instead.
Input:
```unison
type MyType = MyConstructor
```
```ucm
fresh/main> add
fresh/main> delete.term MyType.MyConstructor
fresh/main> view MyType
fresh/main> todo
```
Output:
``` unison
type MyType = MyConstructor
```
``` 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 MyType
```
``` ucm
fresh/main> add
⍟ I've added these definitions:
type MyType
fresh/main> delete.term MyType.MyConstructor
Done.
fresh/main> view MyType
type MyType = #326g7u3sau#0
fresh/main> todo
These types have some constructors with missing names.
1. MyType
You can use `view 1` and
`alias.term <hash> <TypeName>.<ConstructorName>` to give names
to each unnamed constructor.
```
Environment (please complete the following information):
Describe and demonstrate the bug
delete.term
can be used to delete a type's constructor, resulting in an unnamed hash appearing in the type and a result in thetodo
list.I think that instead it should fail letting you know that the constructor has references and for bonus points suggesting that you use
delete.type
on the type instead.Input:
Output:
Environment (please complete the following information):
ucm --version
1e44418The text was updated successfully, but these errors were encountered: