[Mono-bugs] [Bug 507473] Generic type variance problems

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jul 1 15:05:59 EDT 2009


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

User msafar at novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=507473#c3





--- Comment #3 from Marek Safar <msafar at novell.com>  2009-07-01 13:05:56 MDT ---
Test #4

using System;



delegate void D<in T> ();



interface I<out T>

{

    event D<T> field;

}



class D : I<string>

{

    public event D<string> field;



    public static int Main ()

    {

        D<object> dd = () => {};



        D d = new D ();

        d.field += dd;

        d.field ();



        return 0;

    }

}



Mono:

Unhandled Exception: System.InvalidCastException: Cannot cast from source type
to destination type.
  at D.Main () [0x00000]

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list