[Mono-list] Possible mcs bug: CS0019 detected for comparable instances

davejp@volny.cz davejp@volny.cz
Sat, 18 Oct 2003 10:45:50 +0200 (CEST)


--=_f6de8c575d18949531209b78e4bf60b1
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: 7bit

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: mono-list-admin@lists.ximian.com [mailto:mono-list-
> admin@lists.ximian.com] On Behalf Of Rodolfo Campero
> Sent: Saturday, October 18, 2003 1:19 AM
> To: mono-list@lists.ximian.com
> 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  -  Mono-list@lists.ximian.com
> 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


--=_f6de8c575d18949531209b78e4bf60b1
Content-Type: application/ms-tnef
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="winmail.dat"

eJ8+IgwIAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA4gQAAAAAAADmAAEIgAcA
GAAAAElQTS5NaWNyb3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEG
AAcAAQAAAAAAAAEGgAMADgAAANMHCgASAAkALAAAAAYAMQEBA5AGALwLAAAu
AAAACwACAAEAAAALACMAAAAAAAMAJgAAAAAACwApAAAAAAADAC4AAAAAAAIB
MQABAAAAGAAAAAAAAABtAGF1Gg4STbdph6KDCXSThGUgAAMANgAAAAAAHgBw
AAEAAABHAAAAW01vbm8tbGlzdF0gUG9zc2libGUgbWNzIGJ1ZzogQ1MwMDE5
IGRldGVjdGVkIGZvciBjb21wYXJhYmxlIGluc3RhbmNlcwAAAgFxAAEAAAAW
AAAAAcOVU9+tIG7oBSgFQoOewopvxhsqoAAAAgEdDAEAAAAVAAAAU01UUDpE
QVZFSlBAVk9MTlkuQ1oAAAAACwABDgAAAABAAAYOAAiq+VOVwwECAQoOAQAA
ABgAAAAAAAAAbQBhdRoOEk23aYeigwl0k8KAAAADABQOAAAAAAsAHw4BAAAA
HgAoDgEAAAAnAAAAMDAwMDAwMDcBZGF2ZWpwQHZvbG55LmN6AXBvcDMudm9s
bnkuY3oAAB4AKQ4BAAAAJwAAADAwMDAwMDA3AWRhdmVqcEB2b2xueS5jegFw
b3AzLnZvbG55LmN6AAACAQkQAQAAAGsGAABnBgAAhQsAAExaRnU5VT4gAwAK
AHJjcGcxMjXiMgNDdGV4BUEBAwH3/wqAAqQD5AcTAoAP8wBQBFY/CFUHshEl
DlEDAQIAY2jhCsBzZXQyB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