[Mono-bugs] [Bug 592711] New: --debug=casts does not work for arrays

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Mar 31 11:17:26 EDT 2010


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

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


           Summary: --debug=casts does not work for arrays
    Classification: Mono
           Product: Mono: Runtime
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: msafar at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


compile & run

using System;

using System.Collections;

using System.Collections.Generic;



class C<T>

{

    public IEnumerator<T> GetEnumerator ()

    {

        return (IEnumerator<T>) new T[0].GetEnumerator ();

    }



    public IEnumerable<T> Filter (Func<T, bool> predicate)

    {

        foreach (T item in this)

            if (predicate (item))

                yield return item;

    }

}



class M

{

    public static void Main ()

    {

        foreach (var v in new C<long>().Filter(null)) {

        }

    }

}


Unhandled Exception: System.InvalidCastException: Cannot cast from source type
to destination type.

No further details

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