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.
'property' : property or indexer cannot have void type
void is invalid as a return value for a property.
For more information, see Properties.
The following sample generates CS0547:
// CS0547.cs
public class a
{
public void i // CS0547
// Try the following declaration instead:
// public int i
{
get
{
return 0;
}
}
}
public class b : a
{
public static void Main()
{
}
}
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.