http://bugzilla.novell.com/show_bug.cgi?id=499009
Summary: Member Initialization introduces error
Classification: Mono
Product: Mono: Compilers
Version: unspecified
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
Found By: ---
The problem that we have is that we should only assign the result of the new
operation until we have finished initializing. This problem was first
discovered by ASP.NET MVC:
using System;
class Foo {
public int P { get; set; }
}
class Y {
static void Main ()
{
Foo foo = new Foo ();
foo.P = 1;
Do (foo);
Console.WriteLine ("OK");
}
static void Do (Foo f)
{
f = new Foo () {
P = f.P
};
if (f.P != 1)
throw new Exception ("Error, this should have been 1");
}
}
--
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