Compiler Error CS0057
Inconsistent accessibility: parameter type 'type' is less accessible than operator 'operator'
A public construct must return a publicly accessible object. For more information, see Access Modifiers.
The following sample generates CS0057:
// CS0057.cs
class MyClass //defaults to private accessibility
// try the following line instead
// public class MyClass
{
}
public class MyClass2
{
public static implicit operator MyClass2(MyClass iii) // CS0057
{
return new MyClass2();
}
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.
.NET feedback
.NET is an open source project. Select a link to provide feedback: