Skip to content

When using "is" with "and" in pattern matching, branch coverage is lower than normal #1313

@Malivil

Description

@Malivil

Package: coverlet.msbuild
Version: 3.1.2
Format: opencover

Combining the C#7 is with the C#9 and in a pattern-matching if, branch coverage is lower than the same check in traditional boolean logic.

I created a simple repro of this because I cannot show the actual code that caused the problem (it's from my job).

is + and:
image

Traditional:
image

Repro code: https://github.com/Malivil/Coverlet1313Repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions