Skip to content

NET-2999 Fix S6672 FN: Mismatch in primary constructor is not recognized #9784

@jhinder

Description

@jhinder

Description

Currently only constructor declarations are checked. A logger type mismatch in a primary constructor is not yet recognized.

Reproducer

class A(ILogger<C> logger);
//             ^^^ no diagnostic here despite the mismatch

class B
{
    public B(ILogger<C> logger)
//                  ^^^ S6672: Update this logger to use its enclosing type.
    {
    }
}

class C;

Product and Version

SonarQube for Visual Studio 9.4.0.16052

Metadata

Metadata

Assignees

No one assigned

    Labels

    False NegativeRule is NOT triggered when it should be.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions