Skip to content

[BUG] Generic methods are not correct translated #1691

Open
@mischube

Description

@mischube

Describe the bug
I got some C# classes that have 2 methods with the same signature. One has a generic return value and one a fix type. So the outcoming cobertura report has the same function twice which leads to an error in our CI.

To Reproduce
I created a fresh c# library project with this class and a unit test project:

public class Class1
{
    public object GetObject()
    {
        return new object();
    }
    
    public T GetObject<T>() where T : new()
    {
        return new T();
    }
}

image

Created a github repo:
https://github.com/mischube/CoverletGenericIssue

Expected behavior

The generic method should have either a different name or signature

Actual behavior

Both methods have the same identifier.

Configuration (please complete the following information):

* Coverlet: Coverlet.Collector 6.0.0 / 6.0.2
* .NET-SDK 8.0.401
* .NET-Runtime 8.0.8
* WIN 11
* Dont think it is configuration related

Additional context

Seems to be similar to #1077

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementGeneral enhancement requeststaletenet-reportersIssue related to coverage output files(reporters)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions