Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect incomplete pattern matches #364

Open
LightAndLight opened this issue Feb 19, 2023 · 0 comments
Open

Detect incomplete pattern matches #364

LightAndLight opened this issue Feb 19, 2023 · 0 comments
Labels

Comments

@LightAndLight
Copy link
Owner

Incomplete pattern matches aren't detected during type checking and will cause a runtime failure.

f : (| A : String, B ; String |) -> String
f x =
  case x of
    A a -> a

main : IO ()
main = println <| f (B "b")

I'd like ipso to tell me when I've missed a pattern; usually it's unintentional.

Pattern match completeness is a big topic. I might want to break the feature down by type. I might also be able to separate "detecting incomplete patterns" from "calculating missing patterns".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant