Is there a way to warn if pattern matching on a polymorphic variant uses wildcards?

That is, if I have a polymorphic variant type like [`Happy | `Sad | `Angry | `Confused] but only do

match x with
| `Happy -> talk ()
| _ -> nvm ()

I’d like it to warn.

I thought I saw this somewhere before, but perhaps only in my dreams…?

1 Like