http://bugzilla.novell.com/show_bug.cgi?id=567537
http://bugzilla.novell.com/show_bug.cgi?id=567537#c0 Summary: gmcs type compatibility error with generic type array and interface type argument Classification: Mono Product: Mono: Compilers Version: SVN Platform: Other OS/Version: Mac OS X 10.4 Status: NEW Severity: Normal Priority: P5 - None Component: C# AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 gmcs fails to compile the following valid program: using System; using System.Collections.Generic; using NUnit.Framework; interface IFoo { } class ArrayEqualityComparer<T>: IEqualityComparer<T[]> { public bool Equals(T[] x, T[] y) { return false; } public int GetHashCode(T[] args) { return 0; } } public class Program { public static void Main(string[] args) { var d = new Dictionary<IFoo[], IFoo>(new ArrayEqualityComparer<IFoo>()); } } gmcs says "gmcsequalitycomparerbug.cs(26,80): error CS1503: Argument `#1' cannot convert `ArrayEqualityComparer<IFoo>' expression to type `System.Collections.Generic.IEqualityComparer<IFoo[]>'" which is wrong for ArrayEqualityComparer does implement IEqualityComparer<T[]>. "mono --version" reports: Mono JIT compiler version 2.7 (/trunk/mono r148915 Mon Dec 28 15:29:31 BRST 2009) Reproducible: Always Steps to Reproduce: Compile the source code provided in the details with gmcs. Actual Results: gmcsequalitycomparerbug.cs(26,80): error CS1503: Argument `#1' cannot convert `ArrayEqualityComparer<IFoo>' expression to type `System.Collections.Generic.IEqualityComparer<IFoo[]>' Expected Results: no errors -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. You are the assignee for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
