unisonweb / unison

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

clear latestTypecheckedFile on `update` #5270

Closed aryairani closed 3 months ago

aryairani commented 3 months ago

Overview

3424 restated is:

You have a calls b calls c, with a and c in the scratch file but b is not in the scratch file. You modify c and run update.

a, b, c will be updated correctly in the branch, but when you run a it will use the stale one from the Cli state and not the updated one. So it will not reflect the changes you just made to c, which is mystifying.

Your scratch file looks right and view looks right, but run a will call old code until you load again or restart ucm.

This PR fixes the issue by clearing latestTypecheckedFile at the end of update.

Test coverage

Diff of transcript output before and after the fix: https://github.com/unisonweb/unison/commit/c4f8ffcf399d59f80b7f17a2fd9a7f2fc8b0d9e9