unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.68k stars 265 forks source link

`edit` a constructor for a decl with no name is a round-trip error #2886

Open aryairani opened 2 years ago

aryairani commented 2 years ago

Something like:

```unison
unique type Days = Mon | Tue | Wed | Thu | Fri
.> add
.> delete.type Days
.> edit Days.Mon
.> load

with scratch.u

unique type #ujdhd1f2ne = Days.Mon | Days.Tues | Days.Wed | Days.Thurs | Days.Fri

ceedubs commented 2 years ago

@aryairani what do you think that the behavior should be in this case? The behavior that you've shown seems fairly reasonable to me. But I guess that it's problematic that a unique type declaration would try to give its own hash.

sellout commented 2 weeks ago

Is this actually a round-trip bug? Shouldn’t deleting a unique type fail if there are dependencies on that type?

ceedubs commented 2 weeks ago

Shouldn’t deleting a unique type fail if there are dependencies on that type?

Yes. But there are currently some issues such as #5044 that can lead to this situation. And there were even more in the past.