unisonweb / unison

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

Bad error on unknown handler #5304

Open ChrisPenner opened 2 months ago

ChrisPenner commented 2 months ago

Given this code:

abilityMatchTests = do
  handle abort with asldkfjlkj

You get this error:

  The handler used here

      3 |   handle abort with asldkfjlkj

  has type _7 but I'm expecting a function of the form
  Request e a -> o.

It's weird it's saying it has a type, when it clearly doesn't resolve to anything at all.

I'd expect it to say "asldkfjlkj is not in scope, it should have type: Request {Abort} a -> a" or something like that.