[Mono-list] InvalidCastException - mono > 0.28

ashu@cs.cmu.edu ashu@cs.cmu.edu
Wed, 3 Dec 2003 13:50:30 -0500


Hi all,

mono-0.28 and mono-0.29 generates an InvalidCastException during certain
upcasts. The particular case where I get a problem has the following
class hierarchy: 

-------
                 namespace1.SomeotherApplication 
derives from:    namespace1.InternalApplication 
derives from:    namespace1.Application

And the cast I am getting problems with is:
        function(Application app) {     /* here app is of course an instance of SomeotherApplication */
            ... ;
	    ((SomeotherApplication) app).someMethod();
	}
-------

The code runs perfectly fine on a Windows machine. 
I also tried compiling the code on Windows and using mcs-0.28 -- I get
this error in both situations.

Is this a known problem or anything is not properly set up with my
system?

Thanks for your help!
Ashwin
-- 
 _  _               Graduate Student, CS Department, CMU
|_|(_`|_||  |||\ |         +1-412-268-7555 [O] 
| |._)| ||/\||| \|      http://www.cs.cmu.edu/~ashu