unison icon indicating copy to clipboard operation
unison copied to clipboard

definitions don't type check after type-preserving update?

Open ceedubs opened this issue 7 months ago • 1 comments

Describe and demonstrate the bug

Below is a transcript. A couple of things seem wrong to me.

  1. You can see that there is an explicit type signature on abilities.repeat and it doesn't change. So how do definitions fail to type check after the update? **Edit: Oh I kind of figured this out. Unit.doc in base just doesn't compile with the current type checker. #5888 **
  2. Why didn't my new definition of abilities.repeat get picked up the first time but it did when I duplicated the unison stanza?
``` ucm
@unison/base/main> pull.without-history @unison/base/releases/6.1.0

  Updating branch from #sg60bvjo91 to #hs7732nh1g

  ✅

  Successfully updated @unison/base/main from
  @unison/base/releases/6.1.0.

@unison/base/main> edit abilities.repeat

  ☝️

  I added 1 definitions to the top of scratch.u

  You can edit them there, then run `update` to replace the
  definitions currently in this namespace.
```

``` unison :added-by-ucm scratch.u
abilities.repeat : Nat -> '{e} () ->{e} ()
abilities.repeat n op =
  use Nat -
  if n === 0 then ()
  else
    ignore op()
    abilities.repeat (n - 1) op
```

``` unison
abilities.repeat : Nat -> '{e} () ->{e} ()
abilities.repeat n op =
  use Nat -
  if n === 0 then ()
  else
    op()
    abilities.repeat (n - 1) op
```

That didn't do anything. Try it again?

``` unison
abilities.repeat : Nat -> '{e} () ->{e} ()
abilities.repeat n op =
  use Nat -
  if n === 0 then ()
  else
    op()
    abilities.repeat (n - 1) op
```

``` ucm :added-by-ucm
  Loading changes detected in scratch.u.

  ~ abilities.repeat : Nat -> '{e} () ->{e} ()

  ~ (modified)

  Run `update` to apply these changes to your codebase.
```

``` ucm
@unison/base/main> update
```

🛑

The transcript failed due to an error in the stanza above. The error is:

``` 
Some definitions don't typecheck with your changes. I've update
the file scratch.u with the definitions that need fixing. Once
the file is compiling, try `update` again.

I've also switched you to a new branch update-main for this
work. On `update`, it will be merged back into main.
```

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • ucm --version 68a68d299

ceedubs avatar Sep 22 '25 19:09 ceedubs

Okay I think that this issue is really two separate issues.

  • https://github.com/unisonweb/unison/issues/5888
  • One that I've seen @mitchellwrosen mention in which transcript stanzas are ignored. But I can't find a ticket for him. I'll close this out once I make sure that it's tracked.

ceedubs avatar Sep 22 '25 19:09 ceedubs