mail-archives/mono-bugs/2010-July/101882.html

231 строка
6.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 619555] New: Operator error
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20619555%5D%20New%3A%20Operator%20error&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="102177.html">
<LINK REL="Next" HREF="101883.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 619555] New: Operator error</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20619555%5D%20New%3A%20Operator%20error&In-Reply-To="
TITLE="[Mono-bugs] [Bug 619555] New: Operator error">bugzilla_noreply at novell.com
</A><BR>
<I>Fri Jul 2 10:33:19 EDT 2010</I>
<P><UL>
<LI>Previous message: <A HREF="102177.html">[Mono-bugs] [Bug 619542] webHttpBinging is generating wrong responses for methods that return a Stream
</A></li>
<LI>Next message: <A HREF="101883.html">[Mono-bugs] [Bug 619555] Operator error
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#101882">[ date ]</a>
<a href="thread.html#101882">[ thread ]</a>
<a href="subject.html#101882">[ subject ]</a>
<a href="author.html#101882">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="http://bugzilla.novell.com/show_bug.cgi?id=619555">http://bugzilla.novell.com/show_bug.cgi?id=619555</A>
<A HREF="http://bugzilla.novell.com/show_bug.cgi?id=619555#c0">http://bugzilla.novell.com/show_bug.cgi?id=619555#c0</A>
Summary: Operator error
Classification: Mono
Product: Mono: Runtime
Version: SVN
Platform: 64bit
OS/Version: RHEL 5
Status: NEW
Severity: Major
Priority: P5 - None
Component: misc
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">srfcanada at hotmail.com</A>
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
Found By: ---
Blocker: ---
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; MS-RTC LM 8)
the error seems to have appeared in the last couple days checkins. The given
test class doesnt compile on mono but does on windows and used to compile on
mono a few days ago.
1. Test Class:
using System;
using System.Collections.Generic;
namespace Test
{
internal struct TestClass4&lt;T&gt; : IEquatable&lt;TestClass4&lt;T&gt;&gt;, IEquatable&lt;T&gt;,
IEqualityComparer&lt;TestClass4&lt;T&gt;&gt; where T : class
{
public bool Equals(T obj)
{
return true;
}
public bool Equals(TestClass4&lt;T&gt; entry)
{
return true;
}
public bool Equals(TestClass4&lt;T&gt; x, TestClass4&lt;T&gt; y)
{
return x.Equals(y);
}
public int GetHashCode(TestClass4&lt;T&gt; obj)
{
return obj.GetHashCode();
}
public override int GetHashCode()
{
return 1;
}
public override bool Equals(object obj)
{
return false;
}
public static bool operator ==(TestClass4&lt;T&gt; entry1, TestClass4&lt;T&gt;
entry2)
{
return entry1.Equals(entry2);
}
public static bool operator ==(T entry1, TestClass4&lt;T&gt; entry2)
{
return entry2.Equals(entry1);
}
public static bool operator ==(TestClass4&lt;T&gt; entry1, T entry2)
{
return entry1.Equals(entry2);
}
public static bool operator ==(object entry1, TestClass4&lt;T&gt; entry2)
{
return entry2.Equals(entry1);
}
public static bool operator ==(TestClass4&lt;T&gt; entry1, object entry2)
{
return entry1.Equals(entry2);
}
public static bool operator !=(TestClass4&lt;T&gt; entry1, TestClass4&lt;T&gt;
entry2)
{
return !(entry1 == entry2);
}
public static bool operator !=(T entry1, TestClass4&lt;T&gt; entry2)
{
return !(entry1 == entry2);
}
public static bool operator !=(TestClass4&lt;T&gt; entry1, T entry2)
{
return !(entry1 == entry2);
}
public static bool operator !=(object entry1, TestClass4&lt;T&gt; entry2)
{
return !(entry1 == entry2);
}
public static bool operator !=(TestClass4&lt;T&gt; entry1, object entry2)
{
return !(entry1 == entry2);
}
}
}
2. compile it:
gmcs /targe:library test4.cs
3. generates this error on mono:
test4.cs(65,26): error CS0019: Operator `==' cannot be applied to operands of
type `Test.TestClass4&lt;T&gt;' and `Test.TestClass4&lt;T&gt;'
test4.cs(70,26): error CS0019: Operator `==' cannot be applied to operands of
type `T' and `Test.TestClass4&lt;T&gt;'
test4.cs(75,26): error CS0019: Operator `==' cannot be applied to operands of
type `Test.TestClass4&lt;T&gt;' and `T'
test4.cs(80,26): error CS0019: Operator `==' cannot be applied to operands of
type `object' and `Test.TestClass4&lt;T&gt;'
test4.cs(85,26): error CS0019: Operator `==' cannot be applied to operands of
type `Test.TestClass4&lt;T&gt;' and `object'
Compilation failed: 5 error(s), 0 warnings
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
--
Configure bugmail: <A HREF="http://bugzilla.novell.com/userprefs.cgi?tab=email">http://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="102177.html">[Mono-bugs] [Bug 619542] webHttpBinging is generating wrong responses for methods that return a Stream
</A></li>
<LI>Next message: <A HREF="101883.html">[Mono-bugs] [Bug 619555] Operator error
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#101882">[ date ]</a>
<a href="thread.html#101882">[ thread ]</a>
<a href="subject.html#101882">[ subject ]</a>
<a href="author.html#101882">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>