-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is.EqualTo(double).Using(EqualityComparer<double>) causes overload ambiguity error #4916
Comments
@manfred-brands Comment ? |
For comparison, the approach Shouldly took in a very similar scenario was to only declare the new overloads for people who were targeting .NET 9, and thus using C# 13, since C# 13 respects [OverloadResolutionPriorityAttribute]: shouldly/shouldly#984 |
@appel1 If your There was ambiguity in 3.14 and 4.2.2 which you resolved by adding the The difference between 4.2 and 4.3 is that all @OsirisTerje One option would be to drop the old @jnm2 The SDK is independent of the TargetFramework. For one of my work's major projects we move up the SDK to the latest to get language features, but still need to target .NET Framework 4.8 because of 3rd party libraries that are not available for .NET Core. So we could put |
@jnm2 If I add It also complains about the other I must be missing something with this overload resolution or the implementation is not quite right. I have pushed to code to the |
Updated from NUnit 4.2.2 to 4.3.2 and now some tests fail to compile.
We have tests like this where actual and expected are doubles and
DoubleComparer.Approximately()
is a method that returns aEqualityComparer<double>
.This triggers this compilation error:
Current workaround is to introduce an explicit cast in our tests:
The text was updated successfully, but these errors were encountered: