ipso
ipso copied to clipboard
Poor error for incomplete pattern match
This program:
f : (| A : a, r |) -> a
f x =
case x of
A a -> a
main : IO ()
main = io.pure ()
gives this error:
test.ipso:3:8: error: expected type "()", got type "r"
|
3 | case x of
| ^
There are a few problems with this:
- ~~The error is reported in the incorrect position. The caret should point to
xincase x of.~~ Fixed in #184 - The empty row is rendered as
(), which looks like the unit type. Super confusing! - The error only describes the problem indirectly. It would be better to say
expected type "(| A : a |)", got type "(| A : a, r |)". Or better yet, say that the pattern match is incomplete.