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).
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);
}
}
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);
}
.NET feedback
.NET is an open source project. Select a link to provide feedback: