Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking suggestion: Active patterns disables the detection of simple duplicates cases. #586

Open
dsyme opened this issue Jun 22, 2017 · 0 comments

Comments

@dsyme
Copy link
Collaborator

dsyme commented Jun 22, 2017

Tracking this suggestion: dotnet/fsharp#2754

Presence of active patterns disables the detection of simple duplicates cases.

type Foo = A | B | C

let good = function
    | A -> ()
    | B -> ()
    | B -> () // Squiggly with warning "This rule will never be matched"
    | _ -> ()
    | _ -> () // Squiggly with warning "This rule will never be matched"

let (|IsA|_|) x = if x = A then Some () else None

let bad = function            
    | IsA -> ()
    | B -> ()
    | B -> () // no warning
    | _ -> ()
    | _ -> () // no warning

When active patterns are present checking whether a match is exhaustive clearly becomes difficult/impossible but duplicate cases can still be detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant