I tried it in Visual Studio .NET 2003. Compilation successful. Output: Is this wrong? False
Help says: "For reference types other than string, == returns true if its two operands refer to the same object." Both baseRef and interfaceRef refer to the same Test.DerivedClass() > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:mono-list- > [EMAIL PROTECTED] On Behalf Of Rodolfo Campero > Sent: Saturday, October 18, 2003 1:19 AM > To: [EMAIL PROTECTED] > Subject: [Mono-list] Possible mcs bug: CS0019 detected for comparable > instances > > Hello, > I'm trying to port an application I'm developing at work. Over there we > use > Microsoft .Net SDK. > When I tried to compile it in mono I got: > > error CS0019: Operator != cannot be applied to operands of type > `xxx' and > `yyy' > > I've narrowed down the problem and the smallest program which reproduces > the > error is the following one: > > using System; > namespace Test { > public class Test { > public static void Main(string[] args) { > BaseClass baseRef = new DerivedClass(); > ITest interfaceRef = (ITest)baseRef; > Console.WriteLine("Is this wrong? {0}", > (interfaceRef!=baseRef)); > } > } > > public interface ITest {} > > public class BaseClass {} > > public class DerivedClass: BaseClass, ITest {} > } > > Actually, I haven't checked this narrowed-down version in Windows, so if a > gentle soul can do this for me in order to prove that it works I'll > appreciate > it. > I've searched bugzilla for this bug but I didn't found it. If it's right > to > you, I'll file a bug report after someone verify that the code works in > Windows. > I'm using a recent CVS version of mcs and mono, in a RedHat 9 box. > I have a workaround for this problem, so I'm not pressed with this one... > just > wanted to let you know. > > Thanks in advance, > > Rodolfo > > _________________________________________________________________ > Add photos to your messages with MSN 8. Get 2 months FREE*. > http://join.msn.com/?page=features/featuredemail > > _______________________________________________ > Mono-list maillist - [EMAIL PROTECTED] > http://lists.ximian.com/mailman/listinfo/mono-list -- Potrebujete vice prostoru pro vase stranky? Ptejte se na http://sluzby.volny.cz/cs/product/ftp_paid
<<attachment: winmail.dat>>
