[Mono-bugs] [Bug 348255] Bug in turnary operator + nullable types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Dec 23 09:39:03 EST 2007


User alan.mcgovern at gmail.com added comment

--- Comment #2 from Alan McGovern <alan.mcgovern at gmail.com>  2007-12-23 07:39:02 MST ---
I'm confused. Will you grant me that the following two pieces of code are

if (foo)
   return 1;
   return 2;


return foo ? 1 : 2;

If that is the case, then why does the first code segment i pasted up above not
compile, while this (identical) piece of code below does compile. The only
difference is that in case 1 (above) i used turnary style, whereas in case 2
(below) i used if/else:

using System;
using System.Runtime.InteropServices;

namespace Test
        public struct Album
                public int a;
                public Album? Next
                                if(a == 1)
                                        return null;
                                        return new Album();

        public class MainClass
                public static void Main(string[] args)


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