Is there a way to make the F# compiler treat incomplete pattern matches as errors?

Viewed 68

The title says it all, really - is there a setting to instruct the F# compiler to report incomplete pattern matches as errors?

By default this generates warnings but without a specific error code, so I wouldn't know how to apply the --warnaserror compiler option.

When adding a case to a discriminated union, for example, this would be useful to make sure no cases of consuming that DU were missed. Admittedly the compiler warnings can be used for that purpose, but it would be harder to inadvertently ignore errors.

0 Answers
Related