[Mono-bugs] [Bug 442122] Better handling of read-only method variables which appear in closures.
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Nov 6 05:26:43 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=442122
User lunchtimemama at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=442122#c2
Scott Peterson <lunchtimemama at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WONTFIX |
--- Comment #2 from Scott Peterson <lunchtimemama at gmail.com> 2008-11-06 03:26:42 MST ---
No, of course the variable has to be captured for use by the lambda, but the
captured value should not be used later in the enclosing method. The call to
DoSomethindWithAnInt looks something like this:
ldloc.0
ldfld int32 <Foo>__AnonStorey1::i
call void MyType::DoSomethindWithAnInt (int32)
Instead, it should look like this:
ldarg.0
call void MyType::DoSomethindWithAnInt (int32)
Since the value of the argument cannot change after it was captured, we might
as well save ourselves the IL instruction.
--
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.
More information about the mono-bugs
mailing list