https://bugzilla.novell.com/show_bug.cgi?id=666403
https://bugzilla.novell.com/show_bug.cgi?id=666403#c1 Sebastien Pouliot <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Sebastien Pouliot <[email protected]> 2011-01-23 02:12:41 UTC --- Good test cases :) + StreamReader Success9 () + { + return new StreamReader ("baz.xml"); //return value + } That will not report a defect. However I do not like the current optimization (it's too general, i.e. there could be other locals not disposed). + bool Success10 (out StreamReader stream) + { + var new_stream = new StreamReader ("baz.xml"); //out param + stream = new_stream; + return true; + } That would work if coded like this: + var stream = new StreamReader ("baz.xml"); //out param + return true; since it avoids a local. Right now the code depends on 'Instruction' instead of 'VariableDefinition' which makes tracking locals against several condition (e.g. the 'ref' use) impossible. The 3rd case is similar (it works when eliminating the variable). Again tracking this requires tracking VariableDefinition instead of Instruction. Sadly it's a bit of a big change, too big to backport to 2-10 so it will need to wait for v.next. But I'll commit this (and the variations) to master soon. Keeping this open until resolved. -- 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. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
