-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Version Used:
> dotnet --version
6.0.100-rc.1.21452.4
Steps to Reproduce:
- Unzip this somewhere: repro.zip
dotnet buildfails with:
Program.cs(3,8): error CS0121: The call is ambiguous between the following methods or properties: 'Assert.That(TestDelegate, IResolveConstraint)' and 'Assert.That<TActual>(TActual, IResolveConstraint)'
- If you uncomment
<LangVersion>9.0</LangVersion>it works.
The problematic method is NUnit:
Assert.That(() => { }, Throws.Nothing);We hit this in .NET MAUI here:
The breaking change might be expected. The part that is concerning, is we had some unit tests fail at runtime due to a similar issue, where changing LangVersion=9.0 fixed the test failure:
I thought it might be worth checking into, thanks!
Expected Behavior:
NUnit Assert.That(() => { }, Throws.Nothing); compiles in C# 10?
Actual Behavior:
NUnit Assert.That(() => { }, Throws.Nothing); doesn't compile under C# 10.
Reactions are currently unavailable