Compiler Error CS0555
User-defined operator cannot take an object of the enclosing type and convert to an object of the enclosing type
User-defined conversions to values of the enclosing class are not allowed; you do not need such an operator.
The following sample generates CS0555:
// CS0555.cs
public class MyClass
{
// delete the following operator to resolve this CS0555
public static implicit operator MyClass(MyClass aa) // CS0555
{
return new MyClass();
}
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: