[Mono-list] Problem with the 'is' operator, a bug in the mono
Dwivedi , Ajay Kumar
Thu, 27 Jun 2002 11:08:48 +0100
> if (modem is ISpherical)
> ISpherical isModem = (ISpherical) modem;
> The problem is that modem does not support the ISpherical
> interface but
> when I compile the program and run it, there is no exception thrown
> telling me it was an invalid cast.
Are you expecing a cast Exception??? the code within the if block
is not run since modem is not a ISpherical.
Try adding an else statement, and see if it gets executed.