Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The tuple element names in the signature of method must match the tuple element names of interface method (including on the return type).
Example
The following sample generates CS8141:
// CS8141.cs (10,27)
using System.Collections;
public interface IGrabber<out T>
{
T GetOne();
}
class SomeGrabber : IGrabber<(int, int)>
{
public (int a, int b) GetOne()
{
return (1, 2);
}
}
To correct this error
Changing the signature of the GetOne method to return an unnamed tuple, matching the unnamed tuple in the interface, will correct this error:
public (int, int) GetOne()
{
return (1, 2);
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.