[Mono-bugs] [Bug 564095] New: Construct of System.Collections.Generic.List<T>(IEnumerable<T> e) creates list with e.Count null-Elements

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Dec 11 12:45:38 EST 2009


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

http://bugzilla.novell.com/show_bug.cgi?id=564095#c0


           Summary: Construct of
                    System.Collections.Generic.List<T>(IEnumerable<T> e)
                    creates list with e.Count null-Elements
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: 64bit
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: krautz at inf.ethz.ch
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development
           Blocker: ---


Description of Problem:

When trying to retrieve custom attribute data from assembly the returned list
cannot be simply put into new List<T> by using the constructor
List<T>(IEnumerable<T> e). This procedure yields a new list of the same size as
the old but with all elements being null.

Steps to reproduce the problem:

IList<CustomAttributeData> icads =
CustomAttributeData.GetCustomAttributes(Assembly.GetExecutingAssembly());

foreach (CustomAttributeData icad in icads) {
    Console.WriteLine("icad: " + icad);
}

List<CustomAttributeData> cads = new List<CustomAttributeData>(icads);

foreach (CustomAttributeData cad in cads) {
    Console.WriteLine("cad: " + cad);
}


Actual Results:

icad: [System.Reflection.AssemblyTitleAttribute("BioNICsApp")]
icad: [System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(,
WrapNonExceptionThrows = True)]
..
cad:
cad:
..

Expected Results:

icad: [System.Reflection.AssemblyTitleAttribute("BioNICsApp")]
icad: [System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(,
WrapNonExceptionThrows = True)]
..
cad: [System.Reflection.AssemblyTitleAttribute("BioNICsApp")]
cad: [System.Runtime.CompilerServices.RuntimeCompatibilityAttribute(,
WrapNonExceptionThrows = True)]
..


How often does this happen? 

Always.

Additional Information:

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