Skip to content

Only works for matching on enums directly #1

Open
@Manishearth

Description

@Manishearth

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions