Compiler Error CS1715
'Type1': type must be 'Type2' to match overridden member 'MemberName'
This error is the same as Compiler Error CS0508, except that CS0508 now only applies to methods that have return types, while CS1715 applies to properties and indexers that only have 'types' instead of 'return types'.
The following code generates CS1715.
C#
// CS1715.cs
abstract public class Base
{
abstract public int myProperty
{
get;
set;
}
}
public class Derived : Base
{
int myField;
public override double myProperty // CS1715
// try the following line instead
// public override int myProperty
{
get { return myField; }
set { myField;= value; }
}
public static void Main()
{
Derived d = new Derived();
d.myProperty = 5;
}
}
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.
.NET feedback
.NET is an open source project. Select a link to provide feedback: