What should happen with match exprs which have non-exhaustive cases? #4900
StachuDotNet
started this conversation in
Feedback
Replies: 1 comment
-
imo the correct way to handle this is sorta like we did it in Darklang classic, which was explicitly designed with the idea that you can run incomplete code. In the current version, the design is:
These rules seem fine to handle exhaustiveness checking I think? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This match expression exhausts all possible cases of the value it matches against:
This one does not:
F# warns about non-exhaustive match exprs, whenever it can, noting something like
warning FS0025: Incomplete pattern matches on this expression. For example, the value 'false' may indicate a case not covered by the pattern(s).
Dark currently doesn't type-check to ensure
match
es are "exhaustive." (rather, it just deals with any missing matches at run-time)Should it? If so, how and when?
Some quick thoughts:
| _ ->
case at the endBeta Was this translation helpful? Give feedback.
All reactions