unisonweb / unison

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

compile claims to look for test in the scratch file but does not #5279

Open ceedubs opened 3 months ago

ceedubs commented 3 months ago

Describe and demonstrate the bug

If you attempt the compile command on a term that is in your scratch file but has not yet been added to your codebase then it fails, but it reports that it looked in the most recent scratch file save.

Screenshots

scratch/main> 

  Loading changes detected in ~/code/unison/scratch.u.

  I found and typechecked these definitions in ~/code/unison/scratch.u. If you do an `add` or
  `update`, here's how your codebase would change:

    ⍟ These new definitions are ok to `add`:

      main : '()

scratch/main> compile main main

  😶

  I looked for a function `main` in the most recently typechecked file and codebase but couldn't
  find one. It has to have the type:

    main : '{IO, Exception} result

Environment (please complete the following information):

Additional context

Similar to #3654

aryairani commented 3 months ago

Good catch thanks. Does compile.native have the same issue?

ceedubs commented 3 months ago

Yes compile.native has the same issue

hojberg commented 2 months ago

Seems like the error message is right, but the behavior is wrong: we should look for the term in the scratch file.