[Mono-bugs] [Bug 320236] mcs casting error not caught

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 5 11:52:16 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=320236#c3





--- Comment #3 from Marek Safar <msafar at novell.com>  2007-11-05 09:52:15 MST ---
Here is the test case.

enum E
{
        V
}

struct S
{
        public static explicit operator int (S val)
        {
                return 1;
        }
}

class C
{
        E Foo ()
        {
                S s = new S ();
                return (E)s;
        }

        public static void Main ()
        {
        }
}

Expected: error CS0030: Cannot convert type `S' to `E'


-- 
Configure bugmail: https://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