unisonweb / unison

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

Exception thrown when `run`ning a non-existant term called `main` #4553

Open zetashift opened 6 months ago

zetashift commented 6 months ago

I accidentally used the command run with a term that does not exist:

leer/main> run main
Encountered exception:
multiple matching refs
CallStack (from HasCallStack):
  error, called at src/Unison/Codebase/MainTerm.hs:56:20 in unison-parser-typechecker-0.0.0-HLhRfJvV6AvAZ9nxhsSOYZ:Unison.Codebase.MainTerm

Info

Reproduce

The following can be run with ucm transcript reproduce.md

.> project.create-empty
.> pull @unison/cloud-start/releases/latest
.> run main
aryairani commented 6 months ago

Yikes. Ok thanks.

runarorama commented 5 months ago

Just ran into this on livestream with more than one main defined in the project. If you have foo.main and bar.main and say run main you get this same error message. Should instead say something like "I found multiple definitions matching main. Here they are. Try using a more specific name: [list of suffixified names]".

In fact, make it a numbered list so I can say run 2 on the next prompt.