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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to