Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[.NET 9] IsEqualTo is ambiguous for numbers when using TUnit.Assertions.Extensions.Generic #922

Copy link
Copy link

Description

@BarionLP
Issue body actions

The call [IsEqualTo] is ambiguous between the following methods or properties: 'TUnit.Assertions.Extensions.NumberIsExtensions.IsEqualTo(TUnit.Assertions.AssertConditions.Interfaces.IValueSource, TActual, string)' and 'TUnit.Assertions.Extensions.Generic.GenericIsExtensions.IsEqualTo(TUnit.Assertions.AssertConditions.Interfaces.IValueSource, TActual, string)'

I have multiple cases where it would be nice to have both methods in the same test class (of course I could always split the class but that creates a bunch of small files)

I assume you implement IsEqualTo for each number type (in my case int) and for IEquatable but all number types implement IEquatable. In .NET 9 you can fix this by adding the OverloadResolutionPriorityAttribute to one of the methods. but i think you only need one of the methods. OverloadResolutionPriorityAttribute only seems works for methods in the same class.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.