Show/Hide Toolbars

XSharp

Type of conditional expression cannot be determined because there is no implicit conversion between 'class1' and 'class2'

 

Conversions between classes are useful when you want objects of different classes to work with the same code. However, two classes that work together cannot have mutual and redundant conversions, or no implicit conversions. The types of class1 and class2 are determined independently, and the more general type is selected as the type of the conditional expression. For more information about how types are determined, see Conditional operator cannot cast implicitly.

 

To resolve XS0173, verify that there is one and only one implicit conversion between class1 and class2, regardless of which direction the conversion is in and regardless of which class the conversion is in. For more information, see Implicit Numeric Conversions Table and Conversion Operators.

Example

 

The following sample generates XS0173:

 

 

// XS0173.prg