Skip to content
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

error CS0121: "The call is ambiguous between the following methods or properties" after upgrade from net5.0 to 6.0.0-rc.1.21451.3 #57101

Closed
christothes opened this issue Oct 12, 2021 · 3 comments
Labels
Area-Compilers New Feature - Lambda Improvements Resolution-Duplicate The described behavior is tracked in another issue

Comments

@christothes
Copy link

Description

For code that compiled with no errors on .net5, the following errors appeared after upgrading to 6.0.0-rc.1.21451.3:

error CS0121: The call is ambiguous between the following methods or properties: 'Assert.That<TActual>(ActualValueDelegate<TActual>, IResolveConstraint)' and 'Assert.That<TActual>(TActual, IResolveConstraint)'

Reproduction Steps

Attempt to compile the following NUnit assertion

Assert.That(() => Foo.Bar(), Throws.InstanceOf<ArgumentNullException>());

public class Foo
{
	public void Bar()
	{
		throw new ArgumentNullException();
	}
}

Expected behavior

Code compiles without error

Actual behavior

error CS0121: The call is ambiguous between the following methods or properties: 'Assert.That(ActualValueDelegate, IResolveConstraint)' and 'Assert.That(TActual, IResolveConstraint)'

Regression?

Does not reproduce with .net 5.0.10

Known Workarounds

No response

Configuration

6.0.0-rc.1.21451.3
Windows 11 x64

Other information

No response

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@stephentoub stephentoub transferred this issue from dotnet/runtime Oct 12, 2021
@stephentoub
Copy link
Member

cc: @cston

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 12, 2021
@cston
Copy link
Member

cston commented Oct 12, 2021

Thanks for reporting this @christothes.

This looks like a duplicate of #56167 that should be fixed in .NET 6 RC2.

@jaredpar jaredpar added Resolution-Duplicate The described behavior is tracked in another issue and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers New Feature - Lambda Improvements Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

5 participants