|
Bugzilla – Full Text Bug Listing |
| Summary: | Member Initialization introduces error | ||
|---|---|---|---|
| Product: | [Mono] Mono: Compilers | Reporter: | Miguel de Icaza <miguel> |
| Component: | C# | Assignee: | Mono Bugs <mono-bugs> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Mono Bugs <mono-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
This is a duplicate of #496922 *** This bug has been marked as a duplicate of bug 496922 *** |
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"); } }