Skip to content

"This rule is never matched" warning is not shown if an active pattern is used in match expression #7177

Open
@vasily-kirichenko

Description

@vasily-kirichenko
let _ =
    match obj() with
    | x -> ()
    | _ -> ()
    | _ -> ()

results with proper warnings:

image

However, if an active pattern is used in match expression, there are no warnings at all:

let (|AP|_|) x = Some()

let _ =
    match obj() with
    | AP -> ()
    | _ -> ()
    | _ -> ()

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-PatternMatchingpattern compilation, active patterns, performance, codegenBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions