Skip to content

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

@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

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

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions