[Mono-bugs] [Bug 383993] [GMCS] invalid IL generated for comparison of enum with null

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Apr 25 19:05:17 EDT 2008


User gert.driesen at pandora.be added comment

Gert Driesen <gert.driesen at pandora.be> changed:

           What    |Removed                                         |Added
                 CC|                                                |gert.driesen at pandora.be
            Summary|invalid IL generated for comparison of enum with|[GMCS] invalid IL generated for comparison of
                   |null                                            |enum with null

--- Comment #2 from Gert Driesen <gert.driesen at pandora.be>  2008-04-25 17:05:17 MST ---
Simpler repro:

using System;

class Program
        static int Main ()
                Error error = Error.FILE_NOT_FOUND;
                return (error == null) ? 1 : 0;

internal enum Error

Expected result:

test.cs(8,11): warning CS0472: The result of the expression is always 'false'
        since a value of type 'Error' is never equal to 'null' of type 'Error?'

running it should result in exit code 0.

Actual result:

No warning on compile and InvalidProgramException running it.

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