You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the issue when I tried to include the output into a Jenkins CI. The coverage plugin threw an Exception, that there is already an item with the key. Just as context, here is the exception thrown by Jenkins:
java.lang.IllegalArgumentException: There is already a child [METHOD] AddSingletonSystem.Void (Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Func`2<System.IServiceProvider,T>) <0> with the name AddSingletonSystem.Void (Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Func`2<System.IServiceProvider,T>) in [CLASS] Extensions.DependencyInjectionExtensions <3, LINE: 0.00% (0/12)>
The text was updated successfully, but these errors were encountered:
kert-stratec
changed the title
Generics methods share the same name and signature
Generic methods share the same name and signature
May 6, 2024
It's not just cobertura (which is a downstream format) that does not handle this edge case; the base OpenCover format doesn't record the information, so has two method entries of the same name, differing by metadata token. AltCover's JSON format even merges the two methods into one keyed on the non-generic signature. Of all the formats, it's only the ancient NCover that retains the information as it currently stands.
Well, it seems that AltCover perfectly emulates OpenCover for that format, and coverlet for the json format. The latter also merges the two methods in cobertura format, rather than having two records with the same method signature as in this issue.
Hi,
when there are two methods just differentiating based on their derived types, they share the same name and signature in the cobertura output.
Here is an example:
This results in a
cobertura.xml
that looks like this:I noticed the issue when I tried to include the output into a Jenkins CI. The coverage plugin threw an Exception, that there is already an item with the key. Just as context, here is the exception thrown by Jenkins:
The text was updated successfully, but these errors were encountered: