C# permits only certain user-defined conversions to be declared. In particular, it is not possible to redefine an already existing implicit or explicit conversion. A class or struct is permitted to declare a conversion from a source type S
to a target type T
only if all of the following are true:
S
and T
are different types.S
or T
is the class or struct type in which the operator declaration takes place.S
nor T
is object
or an interface-type.T
is not a base class of S
, and S
is not a base class of T
.The restrictions that apply to user-defined conversions are discussed further in §10.9.3.