unisonweb / unison

A friendly programming language from the future

Home Page:https://unison-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve behavior when updating files containing unique types

bgerm opened this issue · comments

When resaving the code with unique types in a new ucm instance I get an unexpected result when I call set on the record type.

Either Account.active.set should behave as if it’s the one you’re about to add, or the unique type Account should just become the same one you’ve already added, when everything matches. (I think this is how we were planning to address it.)
-- Arya Irani

Code:

unique type Account = {
  active: Boolean
}

activate account =
  Account.active.set true account

> activate (Account false)

Result:

  The 1st argument to `activate`

            has type:  Account
      but I expected:  Account#2j43viac7s

      1 | unique type Account = {
      .
      8 | > activate (Account false)