unison/unison-src/transcripts/update-term-with-dependent-to-different-type.output.md
2024-08-01 17:49:45 -04:00

1.3 KiB

scratch/main> builtins.merge

  Done.

foo : Nat
foo = 5

bar : Nat
bar = foo + 10

  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`:
    
      bar : Nat
      foo : Nat

scratch/main> add

  ⍟ I've added these definitions:
  
    bar : Nat
    foo : Nat

foo : Int
foo = +5

  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 names already exist. You can `update` them to your
      new definition:
    
      foo : Int

scratch/main> update

  Okay, I'm searching the branch for code that needs to be
  updated...

  That's done. Now I'm making sure everything typechecks...

  Typechecking failed. I've updated your scratch file with the
  definitions that need fixing. Once the file is compiling, try
  `update` again.

foo : Int
foo = +5

-- The definitions below no longer typecheck with the changes above.
-- Please fix the errors and try `update` again.

bar : Nat
bar =
  use Nat +
  foo + 10