L
Larry Smith
IDerived1 derived1 = GetDerived1();
IDerived2 derived2 = GetDerived2();
IBase ibase = (derived1 != null ? derived1 : derived2);
Where "IDerived1" and "IDerived2" each inherit from "IBase". The followinge
error results on the last line:
Error 32 Type of conditional expression cannot be determined because there
is no implicit conversion between 'Test.IDerived1' and 'Test.IDerived2'
I understand the error but why does the language consider it a problem in
this context. Thanks.
IDerived2 derived2 = GetDerived2();
IBase ibase = (derived1 != null ? derived1 : derived2);
Where "IDerived1" and "IDerived2" each inherit from "IBase". The followinge
error results on the last line:
Error 32 Type of conditional expression cannot be determined because there
is no implicit conversion between 'Test.IDerived1' and 'Test.IDerived2'
I understand the error but why does the language consider it a problem in
this context. Thanks.