Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=75850 --- shadow/75850 2005-08-19 11:45:12.000000000 -0400 +++ shadow/75850.tmp.12272 2005-08-19 11:45:12.000000000 -0400 @@ -0,0 +1,53 @@ +Bug#: 75850 +Product: Mono: Compilers +Version: unspecified +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: C# +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: [GMCS] gmcs incorrect chooses non-generic GetEnumerator () method + +Test case: +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +using System; +using System.Threading; +using System.Collections; +using System.Collections.Generic; + +public class Dict : Dictionary <object, object> +{ +} + +public class Foo +{ + public static void Main () { + IDictionary<object, object> dict = new Dict (); + + dict.Add (new Object (), new Object ()); + foreach (object kv in dict) + Console.WriteLine (kv.GetType ()); + } +} +<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + +When compiling this with gmcs, it prints: +System.Collections.DictionaryEntry + +When compiling it with csc, it prints: +System.Collections.Generic.KeyValuePair`2 + +This is because gmcs generates a call to : + + callvirt instance class[mscorlib]System.Collections.IEnumerator class +[mscorlib]System.Collections.IEnumerable::GetEnumerator() + +while csc generates a call to the generic GetEnumerator () method. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
