Compiler Error CS0126
An object of a type convertible to 'type' is required
A return statement is present, but the statement does not return a value of the expected type. For more information, see Properties.
The following sample generates CS0126:
// CS0126.cs
public class a
{
public int i
{
set
{
}
get
{
return; // CS0126, specify a value to return
}
}
}
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: