Compiler Error CS0030
Cannot convert type 'type' to 'type'
There is no predefined conversion between types. You can define a custom conversion between those types. For more information, see User-defined conversion operators.
The following sample generates CS0030:
// CS0030.cs
namespace x
{
public class iii
{
/*
public static implicit operator iii(int aa)
{
return null;
}
public static implicit operator int(iii aa)
{
return 0;
}
*/
public static iii operator ++(iii aa)
{
return (iii)0; // CS0030
// uncomment the conversion routines to resolve CS0030
}
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: