Description
If I have a struct containing an extensible enum, matching on struct patterns will be ignored on this.
This can be fixed by writing a walker that descends down struct/enum fields to test for extensibility. While this won't fix the fact that an unconstrained type parameter won't be checked, thats fine, since one can't match on these anyway.
After that fix, it can probably be refined to account for wildcards in the right place (eg if we have struct Foo{x : int, y: ExtensibleEnum}
, and all patterns for Foo
are of the form Foo{x: something, ..}
) to avoid false positives. pat_ty
might be useful here, since we can then just walk the pats in the match and ensure that none of them are of an extensible type (unless they are a wildcard in a guardless arm)