-
Notifications
You must be signed in to change notification settings - Fork 53
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
Add option for exhaustive union queries #225
Comments
I'm interested in working on this, though I'm not very familiar with the codebase, @jfrolich is this possible for you to share guide /tips on what should be done? |
Hey, yes that would be amazing. Unfortunately I don't have a lot of time with a newborn. It would be great to have some kind of guide at some point. Most of the difficulty in the codebase is dealing with the OCaml parse tree (ast). I recently started to create |
I would also have to dive in to see how the codebase is tracking exhaustiveness (has been some time ago). |
Probably good to look at |
Thank you, I will take a look |
Looking at native code, it seems when querying a union non exhaustivly it generates another variant ( |
Yeah I think it makes sense to have that instead of FutureAddedValue when it's not exhaustive. |
Following discussions in discord I think it makes sense to have an option to do exhaustive union queries.
let's say I have a union type
I want to get a warning/error when I try to query this type without covering all branches.
How to enable this option?
We can have an option on bsconfig
{ "exhaustiveUnions": true }
and also a directive@exahustive
for cases when people don't want to do exhaustive all union queries. we can also have a@nonexhaustive
directive for suppressing warning/error on a single query when the project wide option is enabled.The text was updated successfully, but these errors were encountered: