[Mono-bugs] [Bug 491858] New: Iterator implementation for generics is incompatible with MS implementation

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 3 07:59:32 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=491858


           Summary: Iterator implementation for generics is incompatible
                    with MS implementation
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: kenneth at hexad.dk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:
Trying to read the itterator of an empty list or dictionary throws an exception
under Mon, but not under MS.

Steps to reproduce the problem:
Sample code:
using System;
using System.Collections.Generic;

public class Test
{
    public static void Main()
    {
        Console.WriteLine("List test");
        List<int> list = new List<int>();
        object cur1 = list.GetEnumerator().Current; //Fails under Mono

        Console.WriteLine("Dictionary test");
        Dictionary<int, LinkedList<int>> dict = new Dictionary<int,
LinkedList<int>>();
        object cur2 = dict.GetEnumerator().Current; //Fails under Mono

        Console.WriteLine("Test done");
    }
}


Actual Results:
Throws an exception under Mono, none under MS, but returns default(T) (zero in
the example).

Expected Results:
Should not throw exception, at least not if compiled against MS libraries.

How often does this happen? 
Every time, easy to reproduce. 
I can reproduce with Ubuntu 8.10 (Mono 1.9?) and WinXP (Mono 2.4).

Additional Information:
May also occur with non-generic lists, I have not tried with those.

-- 
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.


More information about the mono-bugs mailing list