Skip to content

Incomplete compiler warning on pattern matches with guards #11673

Open
@MecuSorin

Description

@MecuSorin

The compiler is truncating the warning on a pattern match with guards that is not covering all possibilities

Repro steps

type Sample = Sample of bool
let example a =
    match a with
    | Sample t when t -> 1
    | Sample t when t -> 2

OR

type Sample = Sample of bool
let example = function
    | Sample t when t -> 1
    | Sample t when t -> 2

Expected behavior

The warning along the lines:
warning FS0025: Incomplete pattern matches on this expression. For example, the value '(Sample false)' may indicate a case not covered by the pattern(s).

Actual behavior
The incomplete warning message:
warning FS0025: Incomplete pattern matches on this expression.

Related information

  • Operating system Windows 10 Pro 64
  • .NET Runtime kind .NET Core 5.0
  • Editing Tools Visual Studio 2019, Visual Studio Code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions