http://bugzilla.novell.com/show_bug.cgi?id=613397
http://bugzilla.novell.com/show_bug.cgi?id=613397#c0 Summary: Object Initializers do not initialize boolean values Classification: Mono Product: Mono: Compilers Version: 2.6.x Platform: x86-64 OS/Version: Ubuntu Status: NEW Severity: Critical Priority: P5 - None Component: C# AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/534.1 (KHTML, like Gecko) Chrome/6.0.427.0 Safari/534.1 Object initializers do not assign values to booleans, they remain in their default constructed state. Reproducible: Always Steps to Reproduce: Compile following code: using System; namespace InlineAssignmentTest { public class Foo { public bool B = true; } public class MainClass { public static void Main(string[] args) { var foo = new Foo() { B = false }; // foo.B should be false but it's true Console.WriteLine("Done: B == " + foo.B); } } } Actual Results: B is true Expected Results: B is false This runs correctly when compiled and run in VS2010. I have not tested compiling in VS2010 and running in mono, or vice-versa. This may also only be related to boolean instance vars and not properties. -- 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. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
