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.
is already listed in the interface list on type with different tuple element names, as.
Example
The following sample generates CS8140:
// CS8140.cs (11,7)
interface I<T>
{
T GetValue();
}
interface I2 : I<(int c, int d)>
{
}
class C : I<(int a, int b)>, I2
{
public (int c, int d) GetValue()
{
return (1, 2);
}
}
To correct this error
Renaming the tuple element names to match the interface declaration corrects this error:
interface I<T>
{
T GetValue();
}
interface I2 : I<(int c, int d)>
{
}
class C : I<(int c, int d)>, I2
{
public (int c, int d) GetValue()
{
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.